[tryton-debian-vcs] tryton-client branch upstream-1.8 created. cc4ce7801b0f745e883686c0ab449bd387d1633c

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Nov 27 16:51:06 UTC 2013


The following commit has been merged in the upstream-1.8 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-client.git;a=commitdiff;h=cc4ce7801b0f745e883686c0ab449bd387d1633c
commit cc4ce7801b0f745e883686c0ab449bd387d1633c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Oct 11 12:27:51 2011 +0200

    Adding upstream version 1.8.3.

diff --git a/CHANGELOG b/CHANGELOG
index 45cc400..b2897eb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.8.3 - 2011-10-01
+* Bug fixes (see mercurial logs for details)
+
 Version 1.8.2 - 2011-05-29
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 5d8f3fd..9742ffd 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: tryton
-Version: 1.8.2
+Version: 1.8.3
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/tryton.egg-info/PKG-INFO b/tryton.egg-info/PKG-INFO
index 5d8f3fd..9742ffd 100644
--- a/tryton.egg-info/PKG-INFO
+++ b/tryton.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: tryton
-Version: 1.8.2
+Version: 1.8.3
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/tryton/common/common.py b/tryton/common/common.py
index d2ea2b4..35627e6 100644
--- a/tryton/common/common.py
+++ b/tryton/common/common.py
@@ -1151,17 +1151,13 @@ def float_time_to_text(val, conv=None):
     val = val - hours
     mins = int((val% 1 + 0.01) / conv['m'])
     if years:
-        value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['Y'],
-                years, True)
+        value += ' ' + locale.format('%d', years, True) + FLOAT_TIME_SEPS['Y']
     if months:
-        value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['M'],
-                months, True)
+        value += ' ' + locale.format('%d', months, True) + FLOAT_TIME_SEPS['M']
     if weeks:
-        value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['w'],
-                weeks, True)
+        value += ' ' + locale.format('%d', weeks, True) + FLOAT_TIME_SEPS['w']
     if days:
-        value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['d'],
-                days, True)
+        value += ' ' + locale.format('%d', days, True) + FLOAT_TIME_SEPS['d']
     if hours or mins:
         value += ' %02d:%02d' % (hours, mins)
     value = value.strip()
diff --git a/tryton/gui/window/view_board/action.py b/tryton/gui/window/view_board/action.py
index 3ec8cee..629aaf9 100644
--- a/tryton/gui/window/view_board/action.py
+++ b/tryton/gui/window/view_board/action.py
@@ -43,7 +43,7 @@ class Action(object):
             self.action['view_mode'] = attrs['view_mode']
 
         self.action.setdefault('pyson_domain', '[]')
-        self.context = {'active_id': False, 'active_ids': []}
+        self.context = {}
         self.context.update(PYSONDecoder(self.context).decode(
             self.action.get('pyson_context', '{}')))
 
diff --git a/tryton/gui/window/view_form/model/group.py b/tryton/gui/window/view_form/model/group.py
index 1c199d7..e4e4235 100644
--- a/tryton/gui/window/view_form/model/group.py
+++ b/tryton/gui/window/view_form/model/group.py
@@ -16,7 +16,7 @@ class Group(SignalEvent, list):
         self.lock_signal = False
         self.__window = window
         self.parent = parent
-        self.parent_name = parent_name
+        self.parent_name = parent_name or ''
         self.parent_datetime_field = parent_datetime_field
         self._context = context or {}
         self.model_name = model_name
diff --git a/tryton/gui/window/view_form/view/form_gtk/image.py b/tryton/gui/window/view_form/view/form_gtk/image.py
index f1356c5..c5d38b5 100644
--- a/tryton/gui/window/view_form/view/form_gtk/image.py
+++ b/tryton/gui/window/view_form/view/form_gtk/image.py
@@ -158,17 +158,17 @@ class Image(WidgetInterface):
             try:
                 loader = gtk.gdk.PixbufLoader(ftype)
                 loader.write(data, len(data))
+                pixbuf = loader.get_pixbuf()
+                loader.close()
             except Exception:
                 continue
-            pixbuf = loader.get_pixbuf()
             if pixbuf:
                 break
         if not pixbuf:
             loader = gtk.gdk.PixbufLoader('png')
             loader.write(NOIMAGE, len(NOIMAGE))
             pixbuf = loader.get_pixbuf()
-
-        loader.close()
+            loader.close()
 
         img_height = pixbuf.get_height()
         if img_height > self.height:
diff --git a/tryton/gui/window/view_form/view/form_gtk/progressbar.py b/tryton/gui/window/view_form/view/form_gtk/progressbar.py
index 1734f5f..79e2b00 100644
--- a/tryton/gui/window/view_form/view/form_gtk/progressbar.py
+++ b/tryton/gui/window/view_form/view/form_gtk/progressbar.py
@@ -16,7 +16,7 @@ class ProgressBar(WidgetInterface):
 
     def __init__(self, field_name, model_name, window, attrs=None):
         super(ProgressBar, self).__init__(field_name, model_name, window,
-                parent, attrs=attrs)
+                attrs=attrs)
         self.widget = gtk.ProgressBar()
         orientation = self.orientations.get(attrs.get('orientation',
             'left_to_right'), gtk.PROGRESS_LEFT_TO_RIGHT)
diff --git a/tryton/gui/window/view_form/view/graph_gtk/graph.py b/tryton/gui/window/view_form/view/graph_gtk/graph.py
index ec1fbb4..0dcd6cf 100644
--- a/tryton/gui/window/view_form/view/graph_gtk/graph.py
+++ b/tryton/gui/window/view_form/view/graph_gtk/graph.py
@@ -122,7 +122,7 @@ class Graph(gtk.DrawingArea):
         self.drawGraph(cx, width, height)
         self.drawAxis(cx, width, height)
         self.drawLegend(cx, width, height)
-        surface.write_to_png(filename)
+        surface.write_to_png(filename.encode('utf-8'))
 
         self.queue_draw()
 
diff --git a/tryton/gui/window/view_form/view/graph_gtk/parser.py b/tryton/gui/window/view_form/view/graph_gtk/parser.py
index 27a5950..03efdcc 100644
--- a/tryton/gui/window/view_form/view/graph_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/graph_gtk/parser.py
@@ -77,7 +77,7 @@ def save(widget, graph, window):
             filename = filename.decode('utf-8')
             try:
                 CONFIG['client.default_path'] = \
-                       os.path.dirname(filepath)
+                       os.path.dirname(filename)
                 CONFIG.save()
             except Exception:
                 pass
diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py
index 9905f5a..5b7933f 100644
--- a/tryton/gui/window/view_form/view/list.py
+++ b/tryton/gui/window/view_form/view/list.py
@@ -513,7 +513,7 @@ class ViewList(ParserView):
             if last_col and last_col.name in fields:
                 del fields[last_col.name]
 
-            if fields:
+            if fields and any(fields.itervalues()):
                 try:
                     rpc.execute('model', 'ir.ui.view_tree_width', 'set_width',
                             self.screen.model_name, fields, rpc.CONTEXT)
diff --git a/tryton/gui/window/win_export.py b/tryton/gui/window/win_export.py
index fee597f..4d1afe1 100644
--- a/tryton/gui/window/win_export.py
+++ b/tryton/gui/window/win_export.py
@@ -304,7 +304,7 @@ class WinExport(object):
         for export in exports:
             self.predef_model.append((
                 export['id'],
-                [x['name'] for x in id2lines[export['id']]],
+                [x['name'] for x in id2lines.get(export['id'], [])],
                 export['name']))
         self.pref_export.set_model(self.predef_model)
 
diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py
index e215077..38e1787 100644
--- a/tryton/gui/window/win_form.py
+++ b/tryton/gui/window/win_form.py
@@ -236,6 +236,7 @@ class WinForm(object):
         self.wid_text.grab_focus()
 
     def _sig_add(self, *args):
+        from tryton.gui.window.win_search import WinSearch
         domain = []
         context = rpc.CONTEXT.copy()
 
diff --git a/tryton/translate.py b/tryton/translate.py
index 8272655..b5a0ad9 100644
--- a/tryton/translate.py
+++ b/tryton/translate.py
@@ -172,11 +172,13 @@ def setlang(lang=None, locale_dict=None):
             elif os.name == 'mac' or \
                     (hasattr(os, 'uname') and os.uname()[0] == 'Darwin'):
                 encoding = 'UTF-8'
+            # ensure environment variable are str
+            lang, lang2, encoding = str(lang), str(lang2), str(encoding)
             os.environ['LANGUAGE'] = lang
             os.environ['LC_ALL'] = lang2 + '.' + encoding
             os.environ['LC_MESSAGES'] = lang2 + '.' + encoding
             os.environ['LANG'] = lang + '.' + encoding
-            locale.setlocale(locale.LC_ALL, str(lang2 + '.' + encoding))
+            locale.setlocale(locale.LC_ALL, lang2 + '.' + encoding)
         except Exception:
             logging.getLogger('translate').info(
                     _('Unable to set locale %s') % lang2 + '.' + encoding)
diff --git a/tryton/version.py b/tryton/version.py
index a49fe66..f4cbb0d 100644
--- a/tryton/version.py
+++ b/tryton/version.py
@@ -1,7 +1,7 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 PACKAGE = "tryton"
-VERSION = "1.8.2"
+VERSION = "1.8.3"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/"
 
commit a70ffd06ed683a6a8f4b661c627aea5236aad1b1
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Aug 8 19:18:33 2011 +0200

    Adding upstream version 1.8.2.

diff --git a/CHANGELOG b/CHANGELOG
index 9389b62..45cc400 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.8.2 - 2011-05-29
+* Bug fixes (see mercurial logs for details)
+
 Version 1.8.1 - 2011-02-13
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index f98ae5c..a5466e7 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -3,6 +3,7 @@ Copyright (C) 2007-2011 Bertrand Chenal.
 Copyright (C) 2008-2011 B2CK SPRL.
 Copyright (C) 2008-2011 Udo Spallek.
 Copyright (C) 2008-2011 virtual things - Preisler & Spallek GbR.
+Copyright (C) 2007-2009 Lorenzo Gil Sanchez.
 Copyright (C) 2004-2008 Tiny SPRL.
 
 This program is free software: you can redistribute it and/or modify
diff --git a/PKG-INFO b/PKG-INFO
index aef0cad..5d8f3fd 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: tryton
-Version: 1.8.1
+Version: 1.8.2
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/tryton.egg-info/PKG-INFO b/tryton.egg-info/PKG-INFO
index aef0cad..5d8f3fd 100644
--- a/tryton.egg-info/PKG-INFO
+++ b/tryton.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: tryton
-Version: 1.8.1
+Version: 1.8.2
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/tryton/common/common.py b/tryton/common/common.py
index 035a716..d2ea2b4 100644
--- a/tryton/common/common.py
+++ b/tryton/common/common.py
@@ -242,7 +242,8 @@ def file_selection(title, filename='', parent=None,
     def update_preview_cb(win, img):
         filename = win.get_preview_filename()
         try:
-            pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128)
+            pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename.encode('utf-8'),
+                    128, 128)
             img.set_from_pixbuf(pixbuf)
             have_preview = True
         except Exception:
diff --git a/tryton/config.py b/tryton/config.py
index 06c054a..c241e58 100644
--- a/tryton/config.py
+++ b/tryton/config.py
@@ -182,7 +182,7 @@ if not os.path.isdir(PIXMAPS_DIR):
         PIXMAPS_DIR = os.path.join(PREFIX, 'share', 'pixmaps', 'tryton')
 
 TRYTON_ICON = gtk.gdk.pixbuf_new_from_file(
-        os.path.join(PIXMAPS_DIR, 'tryton-icon.png'))
+        os.path.join(PIXMAPS_DIR, 'tryton-icon.png').encode('utf-8'))
 
 def _data_dir():
     data_dir = os.path.join(CURRENT_DIR, 'share', 'tryton')
diff --git a/tryton/gui/main.py b/tryton/gui/main.py
index 5f7537d..f329cc0 100644
--- a/tryton/gui/main.py
+++ b/tryton/gui/main.py
@@ -1131,7 +1131,8 @@ class Main(object):
             return ([], [])
 
     def sig_login(self, widget=None, dbname=False, res=None):
-        self.sig_logout(widget, disconnect=False)
+        if not self.sig_logout(widget, disconnect=False):
+            return
         if not res:
             try:
                 dblogin = DBLogin(self.window)
@@ -1292,6 +1293,8 @@ class Main(object):
 
     def sig_plugin_execute(self, widget):
         page = self.notebook.get_current_page()
+        if page == -1:
+            return
         datas = {
                 'model': self.pages[page].model,
                 'ids': self.pages[page].ids_get(),
diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py
index af1fe4c..65b5d32 100644
--- a/tryton/gui/window/view_form/model/field.py
+++ b/tryton/gui/window/view_form/model/field.py
@@ -617,6 +617,9 @@ class ReferenceField(CharField):
         if not value:
             record.value[self.name] = False
             return
+        if isinstance(value, basestring):
+            model, ref_id = value.split(',')
+            value = model, (ref_id, record.value.get(self.name + '.rec_name'))
         ref_model, (ref_id, ref_str) = value
         if ref_model:
             ref_id = int(ref_id)
diff --git a/tryton/gui/window/view_form/view/form_gtk/many2one.py b/tryton/gui/window/view_form/view/form_gtk/many2one.py
index d5e66a3..5b38326 100644
--- a/tryton/gui/window/view_form/view/form_gtk/many2one.py
+++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py
@@ -36,7 +36,7 @@ class Many2One(WidgetInterface):
         self.wid_text.connect('populate-popup', self._populate_popup)
         self.wid_text.connect_after('changed', self.sig_changed)
         self.changed = True
-        self.wid_text.connect_after('activate', self.sig_activate)
+        self.wid_text.connect('activate', self.sig_activate)
         self.wid_text.connect_after('focus-out-event',
                         self.sig_activate)
         self.focus_out = True
@@ -127,6 +127,8 @@ class Many2One(WidgetInterface):
 
         self.focus_out = False
         if not value:
+            if not key_press and not event:
+                widget.emit_stop_by_name('activate')
             if not self._readonly and (self.wid_text.get_text() or \
                     (self.field.get_state_attrs(
                         self.record)['required']) and key_press):
diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py
index a831e50..9905f5a 100644
--- a/tryton/gui/window/view_form/view/list.py
+++ b/tryton/gui/window/view_form/view/list.py
@@ -265,7 +265,7 @@ class ViewList(ParserView):
         act = action.copy()
         obj_ids = self.screen.sel_ids_get()
         obj_id = self.screen.id_get()
-        if not obj_ids and not obj_id:
+        if not obj_ids or not obj_id:
             message(_('No record selected!'), self.window)
             return False
         email = {}
diff --git a/tryton/gui/window/view_form/view/list_gtk/editabletree.py b/tryton/gui/window/view_form/view/list_gtk/editabletree.py
index b7f13cf..c33ef26 100644
--- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py
+++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py
@@ -113,7 +113,7 @@ class EditableTreeView(gtk.TreeView):
     def set_value(self):
         path, column = self.get_cursor()
         model = self.get_model()
-        if not path or not column:
+        if not path or not column or not column.name:
             return True
         record = model.get_value(model.get_iter(path), 0)
         field = record[column.name]
diff --git a/tryton/gui/window/view_form/view/list_gtk/parser.py b/tryton/gui/window/view_form/view/list_gtk/parser.py
index 61ba28e..66434fa 100644
--- a/tryton/gui/window/view_form/view/list_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/list_gtk/parser.py
@@ -267,7 +267,7 @@ class Char(object):
         else:
             align = 0
 
-        states = ('invisible')
+        states = ('invisible',)
         if hasattr(self.treeview, 'editable') \
                 and self.treeview.editable:
             states = ('readonly', 'required', 'invisible')
@@ -678,10 +678,13 @@ class Selection(Char):
         selection_data = gtk.ListStore(str, str)
         selection = self.attrs.get('selection', [])[:]
         self.selection = selection[:]
+        if not self.attrs.get('domain'):
+            domain = []
+        else:
+            domain = PYSONDecoder(rpc.CONTEXT).decode(self.attrs['domain'])
         if 'relation' in self.attrs:
             args = ('model', self.attrs['relation'], 'search_read',
-                    self.attrs.get('domain', []), 0, None, None, ['rec_name'],
-                    rpc.CONTEXT)
+                    domain, 0, None, None, ['rec_name'], rpc.CONTEXT)
             try:
                 result = rpc.execute(*args)
             except Exception, exception:
@@ -700,7 +703,7 @@ class Selection(Char):
                     selection = []
                 self.selection = selection[:]
 
-            for dom in common.filter_domain(self.attrs.get('domain', [])):
+            for dom in common.filter_domain(domain):
                 if dom[1] in ('=', '!='):
                     todel = []
                     for i in xrange(len(selection)):
diff --git a/tryton/gui/window/view_form/widget_search/selection.py b/tryton/gui/window/view_form/widget_search/selection.py
index 931fe50..ecda05e 100644
--- a/tryton/gui/window/view_form/widget_search/selection.py
+++ b/tryton/gui/window/view_form/widget_search/selection.py
@@ -6,6 +6,7 @@ import tryton.rpc as rpc
 import tryton.common as common
 import gobject
 import gettext
+from tryton.pyson import PYSONDecoder
 
 _ = gettext.gettext
 
@@ -40,11 +41,14 @@ class Selection(Interface):
         self._selection = {}
         selection = self.attrs.get('selection', [])
         if 'relation' in self.attrs:
+            if not self.attrs.get('domain'):
+                domain = []
+            else:
+                domain = PYSONDecoder(rpc.CONTEXT).decode(self.attrs['domain'])
             try:
-                result = rpc.execute('model',
-                        self.attrs['relation'], 'search_read',
-                        self.attrs.get('domain', []),
-                        0, None, None, ['rec_name'], rpc.CONTEXT)
+                result = rpc.execute('model', self.attrs['relation'],
+                        'search_read', domain, 0, None, None,
+                        ['rec_name'], rpc.CONTEXT)
                 selection = [(x['id'], x['rec_name']) for x in result]
             except Exception, exception:
                 common.process_exception(exception, parent)
diff --git a/tryton/version.py b/tryton/version.py
index 3ff7aff..a49fe66 100644
--- a/tryton/version.py
+++ b/tryton/version.py
@@ -1,7 +1,7 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 PACKAGE = "tryton"
-VERSION = "1.8.1"
+VERSION = "1.8.2"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/"
 
-- 
tryton-client



More information about the tryton-debian-vcs mailing list