[tryton-debian-vcs] tryton-client branch debian updated. debian/3.2.1-1-2-gfa8ed69

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Jul 3 15:58:35 UTC 2014


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-client.git;a=commitdiff;h=debian/3.2.1-1-2-gfa8ed69

commit fa8ed6957fc8d1cabdc5710c8b4608fa648e4649
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Jul 2 13:46:55 2014 +0200

    Releasing debian version 3.2.2-1.

diff --git a/debian/changelog b/debian/changelog
index 05aec27..4ad66ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-client (3.2.2-1) unstable; urgency=medium
+
+  * Merging upstream version 3.2.2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Wed, 02 Jul 2014 13:46:55 +0200
+
 tryton-client (3.2.1-1) unstable; urgency=medium
 
   * Updating signing key while using now plain .asc files instead of .pgp
commit 2aaf30d0206748e30cc9966cee584ecf4802115e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Jul 2 13:46:53 2014 +0200

    Merging upstream version 3.2.2.

diff --git a/CHANGELOG b/CHANGELOG
index e1911e0..9e23bc9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.2 - 2014-07-02
+* Bug fixes (see mercurial logs for details)
+
 Version 3.2.1 - 2014-05-07
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 83379fc..3464ea1 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tryton
-Version: 3.2.1
+Version: 3.2.2
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/tryton.egg-info/PKG-INFO b/tryton.egg-info/PKG-INFO
index 83379fc..3464ea1 100644
--- a/tryton.egg-info/PKG-INFO
+++ b/tryton.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tryton
-Version: 3.2.1
+Version: 3.2.2
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/tryton/common/button.py b/tryton/common/button.py
index 67a5190..9281d00 100644
--- a/tryton/common/button.py
+++ b/tryton/common/button.py
@@ -33,6 +33,8 @@ class Button(gtk.Button):
     def state_set(self, record):
         if record:
             states = record.expr_eval(self.attrs.get('states', {}))
+            if record.group.readonly or record.readonly:
+                states['readonly'] = True
         else:
             states = {}
         if states.get('invisible', False):
diff --git a/tryton/common/domain_inversion.py b/tryton/common/domain_inversion.py
index c730de6..398744f 100644
--- a/tryton/common/domain_inversion.py
+++ b/tryton/common/domain_inversion.py
@@ -56,7 +56,9 @@ def eval_leaf(part, context, boolop=operator.and_):
         # In the case where the leaf concerns a m2o then having a value in the
         # evaluation context is deemed suffisant
         return bool(context.get(field.split('.')[0]))
-    if operand == '=' and not context.get(field) and boolop == operator.and_:
+    if (operand == '='
+            and context.get(field) is None
+            and boolop == operator.and_):
         # We should consider that other domain inversion will set a correct
         # value to this field
         return True
@@ -323,7 +325,7 @@ def test_and_inversion():
     domain = [['x', '=', 3], ['y', '=', 5]]
     assert domain_inversion(domain, 'z') is True
     assert domain_inversion(domain, 'z', {'x': 2, 'y': 7}) is True
-    assert domain_inversion(domain, 'x', {'y': False}) == [['x', '=', 3]]
+    assert domain_inversion(domain, 'x', {'y': None}) == [['x', '=', 3]]
 
     domain = [['x.id', '>', 5], ['y', '<', 3]]
     assert domain_inversion(domain, 'y') == [['y', '<', 3]]
@@ -343,7 +345,7 @@ def test_or_inversion():
     assert domain_inversion(domain, 'x', {'y': 4, 'z': 'abc'}) is True
 
     domain = ['OR', ['x', '=', 3], ['y', '=', 5]]
-    assert domain_inversion(domain, 'x', {'y': False}) == [['x', '=', 3]]
+    assert domain_inversion(domain, 'x', {'y': None}) == [['x', '=', 3]]
 
     domain = ['OR', ['x', '=', 3], ['y', '>', 5]]
     assert domain_inversion(domain, 'z') is True
@@ -501,6 +503,12 @@ def test_evaldomain():
     assert eval_domain(domain, {'x': -4})
     assert not eval_domain(domain, {'x': 5})
 
+    domain = ['OR', ['x', '>', 0], ['x', '=', None]]
+    assert eval_domain(domain, {'x': 1})
+    assert eval_domain(domain, {'x': None})
+    assert not eval_domain(domain, {'x': -1})
+    assert not eval_domain(domain, {'x': 0})
+
     domain = [['x', '>', 0], ['OR', ['x', '=', 3], ['x', '=', 2]]]
     assert not eval_domain(domain, {'x': 1})
     assert eval_domain(domain, {'x': 3})
diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py
index 95d698e..ad5f3e9 100644
--- a/tryton/gui/window/view_form/model/field.py
+++ b/tryton/gui/window/view_form/model/field.py
@@ -201,7 +201,7 @@ class DateTimeField(Field):
     _default = None
 
     def set_client(self, record, value, force_change=False):
-        if not isinstance(value, datetime.datetime) and value is not None:
+        if isinstance(value, basestring):
             try:
                 value = datetime.datetime(*time.strptime(value,
                         date_format() + ' ' + self.time_format(record))[:6])
@@ -229,7 +229,7 @@ class DateField(Field):
     _default = None
 
     def set_client(self, record, value, force_change=False):
-        if not isinstance(value, datetime.date) and value is not None:
+        if isinstance(value, basestring):
             try:
                 value = datetime.date(*time.strptime(value,
                         date_format())[:3])
@@ -253,7 +253,7 @@ class TimeField(Field):
     _default = None
 
     def set_client(self, record, value, force_change=False):
-        if not isinstance(value, datetime.time) and value is not None:
+        if isinstance(value, basestring):
             try:
                 value = datetime.time(*time.strptime(value,
                         self.time_format(record))[3:6])
@@ -652,7 +652,7 @@ class O2MField(Field):
         if isinstance(value, (int, long)):
             value = [value]
 
-        previous_ids = [r.id for r in record.value.get(self.name) or []]
+        previous_ids = self.get_eval(record)
         self._set_value(record, value)
         # The order of the ids is not significant
         if set(previous_ids) != set(value):
diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py
index de96ddc..37bda2e 100644
--- a/tryton/gui/window/view_form/screen/screen.py
+++ b/tryton/gui/window/view_form/screen/screen.py
@@ -857,6 +857,8 @@ class Screen(SignalEvent):
     def get_buttons(self):
         'Return active buttons for the current view'
         def is_active(record, button):
+            if record.group.readonly or record.readonly:
+                return False
             states = record.expr_eval(button.attrs.get('states', {}))
             return not (states.get('invisible') or states.get('readonly'))
 
diff --git a/tryton/gui/window/view_form/view/form_gtk/char.py b/tryton/gui/window/view_form/view/form_gtk/char.py
index ae25a91..3cf5a2a 100644
--- a/tryton/gui/window/view_form/view/form_gtk/char.py
+++ b/tryton/gui/window/view_form/view/form_gtk/char.py
@@ -92,7 +92,8 @@ class Char(WidgetInterface, TranslateMixin):
         return field.set_client(record, value)
 
     def get_value(self):
-        return self.entry.get_text()
+        entry = self.entry.get_child() if self.autocomplete else self.entry
+        return entry.get_text()
 
     def display(self, record, field):
         super(Char, self).display(record, field)
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 5b14610..04f2d23 100644
--- a/tryton/gui/window/view_form/view/form_gtk/many2one.py
+++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py
@@ -382,9 +382,11 @@ class Many2One(WidgetInterface):
             return
         if not self.record:
             return
-        id_ = self.id_from_value(self.field.get(self.record))
-        if id_ is not None and id_ >= 0:
-            return
+        value = self.field.get(self.record)
+        if self.has_target(value):
+            id_ = self.id_from_value(value)
+            if id_ is not None and id_ >= 0:
+                return
         model = self.get_model()
         update_completion(self.wid_text, self.record, self.field, model)
 
diff --git a/tryton/gui/window/view_form/view/form_gtk/parser.py b/tryton/gui/window/view_form/view/form_gtk/parser.py
index 9c8205e..e7c71f2 100644
--- a/tryton/gui/window/view_form/view/form_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/form_gtk/parser.py
@@ -472,13 +472,13 @@ class ParserForm(ParserInterface):
                 hpaned = gtk.HPaned()
                 container.wid_add(hpaned, colspan=int(attrs.get('colspan', 4)),
                         yexpand=True, yfill=True)
-                (widget, widgets, state_widgets, spam, notebook_list2,
+                (widget, widgets, state_widgets2, spam, notebook_list2,
                     cursor_widget2) = self.parse(model_name, node, fields,
                         paned=hpaned, tooltips=tooltips)
                 if not cursor_widget:
                     cursor_widget = cursor_widget2
                 notebook_list.extend(notebook_list2)
-                state_widgets += state_widgets
+                state_widgets += state_widgets2
                 for widget_name, widgets in widgets.iteritems():
                     dict_widget.setdefault(widget_name, [])
                     dict_widget[widget_name].extend(widgets)
@@ -488,7 +488,7 @@ class ParserForm(ParserInterface):
                 vpaned = gtk.VPaned()
                 container.wid_add(vpaned, colspan=int(attrs.get('colspan', 4)),
                         yexpand=True, yfill=True)
-                (widget, widgets, state_widgets2, spam, notebook_list,
+                (widget, widgets, state_widgets2, spam, notebook_list2,
                     cursor_widget2) = self.parse(model_name, node, fields,
                         paned=vpaned, tooltips=tooltips)
                 if not cursor_widget:
diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py
index 177a945..0077d43 100644
--- a/tryton/gui/window/view_form/view/list.py
+++ b/tryton/gui/window/view_form/view/list.py
@@ -91,7 +91,7 @@ class AdaptModelGroup(gtk.GenericTreeModel):
             group.add(record)
             if not record.parent_name:
                 record.modified_fields.setdefault(prev_group.parent_name)
-                record.value[prev_group.parent_name] = False
+                record.value[prev_group.parent_name] = None
             else:
                 record.modified_fields.setdefault(record.parent_name)
         group.move(record, pos)
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 2dacf90..478cd62 100644
--- a/tryton/gui/window/view_form/view/list_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/list_gtk/parser.py
@@ -1057,6 +1057,8 @@ class Button(object):
     def setter(self, column, cell, store, iter):
         record = store.get_value(iter, 0)
         states = record.expr_eval(self.attrs.get('states', {}))
+        if record.group.readonly or record.readonly:
+            states['readonly'] = True
         invisible = states.get('invisible', False)
         cell.set_property('visible', not invisible)
         readonly = states.get('readonly', False)
diff --git a/tryton/version.py b/tryton/version.py
index 5fd6fdf..145862b 100644
--- a/tryton/version.py
+++ b/tryton/version.py
@@ -1,6 +1,6 @@
 #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 = "3.2.1"
+VERSION = "3.2.2"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/"
-- 
tryton-client



More information about the tryton-debian-vcs mailing list