[tryton-debian-vcs] tryton-client branch upstream-2.6 updated. upstream/2.6.9-1-ge38ebed

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Mon May 12 16:06:25 UTC 2014


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

commit e38ebed14e3b81e02fed020aceed138799329240
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon May 12 16:36:22 2014 +0200

    Adding upstream version 2.6.10.

diff --git a/CHANGELOG b/CHANGELOG
index 467af70..3b8bb9f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.6.10 - 2014-05-06
+* Bug fixes (see mercurial logs for details)
+
 Version 2.6.9 - 2014-04-07
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 80da5e4..a5096ae 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tryton
-Version: 2.6.9
+Version: 2.6.10
 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 80da5e4..a5096ae 100644
--- a/tryton.egg-info/PKG-INFO
+++ b/tryton.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tryton
-Version: 2.6.9
+Version: 2.6.10
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/tryton/common/domain_inversion.py b/tryton/common/domain_inversion.py
index 1b72db6..7a03f51 100644
--- a/tryton/common/domain_inversion.py
+++ b/tryton/common/domain_inversion.py
@@ -20,7 +20,7 @@ OPERATORS = {
     '>=': operator.ge,
     '!=': operator.ne,
     'in': in_,
-    'not in': lambda a, b: not in_(b, a),
+    'not in': lambda a, b: not in_(a, b),
     # Those operators are not supported (yet ?)
     'like': lambda a, b: True,
     'ilike': lambda a, b: True,
@@ -462,6 +462,13 @@ def test_evaldomain():
     assert eval_domain(domain, {'x': [3, 4]})
     assert not eval_domain(domain, {'x': [1, 2]})
 
+    domain = [['x', 'not in', [3, 5]]]
+    assert not eval_domain(domain, {'x': 3})
+    assert eval_domain(domain, {'x': 4})
+    assert not eval_domain(domain, {'x': [3]})
+    assert not eval_domain(domain, {'x': [3, 4]})
+    assert eval_domain(domain, {'x': [1, 2]})
+
     domain = ['OR', ['x', '>', 10], ['x', '<', 0]]
     assert eval_domain(domain, {'x': 11})
     assert eval_domain(domain, {'x': -4})
diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py
index 7b5b764..c994f44 100644
--- a/tryton/gui/window/view_form/model/field.py
+++ b/tryton/gui/window/view_form/model/field.py
@@ -50,7 +50,7 @@ class CharField(object):
         screen_domain = domain_inversion(record.group.domain4inversion,
             self.name, EvalEnvironment(record, False))
         if isinstance(screen_domain, bool) and not screen_domain:
-            screen_domain = [('id', '=', False)]
+            screen_domain = [('id', '=', None)]
         elif isinstance(screen_domain, bool) and screen_domain:
             screen_domain = []
         attr_domain = record.expr_eval(self.attrs.get('domain', []))
@@ -211,13 +211,14 @@ class DateTimeField(CharField):
     _default = None
 
     def set_client(self, record, value, force_change=False):
-        if not isinstance(value, datetime.datetime):
+        if not isinstance(value, datetime.datetime) and value is not None:
             try:
                 value = datetime.datetime(*time.strptime(value,
                         date_format() + ' ' + self.time_format(record))[:6])
-                value = common.untimezoned_date(value)
             except ValueError:
                 value = self._default
+        if value:
+            value = common.untimezoned_date(value)
         super(DateTimeField, self).set_client(record, value,
             force_change=force_change)
 
@@ -238,12 +239,15 @@ class DateField(CharField):
     _default = None
 
     def set_client(self, record, value, force_change=False):
-        if not isinstance(value, datetime.date):
+        if not isinstance(value, datetime.date) and value is not None:
             try:
                 value = datetime.date(*time.strptime(value,
                         date_format())[:3])
             except ValueError:
                 value = self._default
+        elif isinstance(value, datetime.datetime):
+            assert(value.time() == datetime.time())
+            value = value.date()
         super(DateField, self).set_client(record, value,
             force_change=force_change)
 
@@ -259,12 +263,14 @@ class TimeField(CharField):
     _default = None
 
     def set_client(self, record, value, force_change=False):
-        if not isinstance(value, datetime.time):
+        if not isinstance(value, datetime.time) and value is not None:
             try:
                 value = datetime.time(*time.strptime(value,
                         self.time_format(record))[3:6])
             except ValueError:
                 value = None
+        elif isinstance(value, datetime.datetime):
+            value = value.time()
         super(TimeField, self).set_client(record, value,
             force_change=force_change)
 
diff --git a/tryton/gui/window/view_form/view/form_gtk/calendar.py b/tryton/gui/window/view_form/view/form_gtk/calendar.py
index 14e40ac..f6bafc7 100644
--- a/tryton/gui/window/view_form/view/form_gtk/calendar.py
+++ b/tryton/gui/window/view_form/view/form_gtk/calendar.py
@@ -45,8 +45,7 @@ class Calendar(WidgetInterface):
         return self.entry.grab_focus()
 
     def set_value(self, record, field):
-        field.set_client(record, self.entry.get_text())
-        return True
+        field.set_client(record, self.get_value())
 
     def get_format(self, record, field):
         return date_format()
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 b003f00..68e731f 100644
--- a/tryton/gui/window/view_form/view/list_gtk/parser.py
+++ b/tryton/gui/window/view_form/view/list_gtk/parser.py
@@ -63,7 +63,7 @@ def sort_model(column, treeview, screen):
     store = treeview.get_model()
     unsaved_records = [x for x in store.group if x.id < 0]
     search_string = screen.screen_container.get_text() or None
-    if screen.search_count == len(store) or unsaved_records:
+    if screen.search_count == len(store) or unsaved_records or screen.parent:
         ids = screen.search_filter(search_string=search_string, only_ids=True)
         store.sort(ids)
     else:
diff --git a/tryton/version.py b/tryton/version.py
index 68a2e09..8609e43 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 = "2.6.9"
+VERSION = "2.6.10"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/"
-- 
tryton-client



More information about the tryton-debian-vcs mailing list