[tryton-debian-vcs] tryton-client branch upstream-2.6 updated. upstream/2.6.13-1-gb7cb8bd

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Nov 12 13:47:09 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.13-1-gb7cb8bd

commit b7cb8bd5bd8f9e4a0938a37f8b7cb872f62ef7e0
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Nov 12 13:50:38 2014 +0100

    Adding upstream version 2.6.14.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 7c5209c..64e31fc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.6.14 - 2014-11-06
+* Bug fixes (see mercurial logs for details)
+
 Version 2.6.13 - 2014-09-29
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index a0f1c58..0c4c937 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: tryton
-Version: 2.6.13
+Version: 2.6.14
 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 a0f1c58..0c4c937 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.13
+Version: 2.6.14
 Summary: Tryton client
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/tryton/common/domain_parser.py b/tryton/common/domain_parser.py
index e374140..492638f 100644
--- a/tryton/common/domain_parser.py
+++ b/tryton/common/domain_parser.py
@@ -117,12 +117,20 @@ def quote(value):
     "Quote string if needed"
     if not isinstance(value, basestring):
         return value
+    if '"' in value:
+        value = value.replace('"', '\\"')
     for test in (':', ' ', '(', ')') + OPERATORS:
         if test in value:
             return '"%s"' % value
     return value
 
 
+def test_quote():
+    assert quote('test') == 'test'
+    assert quote('foo bar') == '"foo bar"'
+    assert quote('"foo"') == '\\\"foo\\\"'
+
+
 def ending_clause(domain, deep=0):
     "Return the ending clause"
     if not domain:
@@ -1091,6 +1099,9 @@ def test_group():
     assert rlist(dom.group(udlex(u'Name:'))) == [
         ('Name', None, ''),
         ]
+    assert rlist(dom.group(udlex(u'Name: \\"foo\\"'))) == [
+        ('Name', None, '"foo"'),
+        ]
 
 
 def test_parse_clause():
diff --git a/tryton/gui/window/view_form/model/group.py b/tryton/gui/window/view_form/model/group.py
index da93272..3143dc4 100644
--- a/tryton/gui/window/view_form/model/group.py
+++ b/tryton/gui/window/view_form/model/group.py
@@ -79,9 +79,13 @@ class Group(SignalEvent, list):
         return [head] + self.clean4inversion(tail)
 
     def __get_domain4inversion(self):
-        if self.__domain4inversion is None:
-            self.__domain4inversion = self.clean4inversion(self.domain)
-        return self.__domain4inversion
+        domain = self.domain
+        if (self.__domain4inversion is None
+                or self.__domain4inversion[0] != domain):
+            self.__domain4inversion = (
+                domain, self.clean4inversion(domain))
+        domain, domain4inversion = self.__domain4inversion
+        return domain4inversion
 
     domain4inversion = property(__get_domain4inversion)
 
diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py
index d1ec7b3..ee5ea05 100644
--- a/tryton/gui/window/view_form/screen/screen.py
+++ b/tryton/gui/window/view_form/screen/screen.py
@@ -710,7 +710,9 @@ class Screen(SignalEvent):
         if view.view_type == 'tree' and len(self.group):
             start, end = view.widget_tree.get_visible_range()
             vadjustment = view.widget_tree.get_vadjustment()
-            vadjustment.value = vadjustment.value + vadjustment.page_increment
+            vadjustment.value = min(
+                vadjustment.value + vadjustment.page_increment,
+                vadjustment.get_upper())
             store = view.store
             iter_ = store.get_iter(end)
             self.current_record = store.get_value(iter_, 0)
@@ -754,7 +756,9 @@ class Screen(SignalEvent):
         if view.view_type == 'tree' and len(self.group):
             start, end = view.widget_tree.get_visible_range()
             vadjustment = view.widget_tree.get_vadjustment()
-            vadjustment.value = vadjustment.value - vadjustment.page_increment
+            vadjustment.value = min(
+                vadjustment.value - vadjustment.page_increment,
+                vadjustment.get_lower())
             store = view.store
             iter_ = store.get_iter(start)
             self.current_record = store.get_value(iter_, 0)
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 a5fc0d2..e73d2bc 100644
--- a/tryton/gui/window/view_form/view/form_gtk/many2one.py
+++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py
@@ -304,9 +304,12 @@ class Many2One(WidgetInterface):
                 position = self.wid_text.get_position()
                 self.field.set_client(self.record,
                     self.value_from_id(None, ''))
-                # Restore text and position after display
-                self.wid_text.set_text(text)
-                self.wid_text.set_position(position)
+                # The value of the field could be different of None
+                # in such case, the original text should not be restored
+                if not self.wid_text.get_text():
+                    # Restore text and position after display
+                    self.wid_text.set_text(text)
+                    self.wid_text.set_position(position)
             gobject.idle_add(clean)
         return False
 
diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py
index 6f1ebab..f9c437f 100644
--- a/tryton/gui/window/win_form.py
+++ b/tryton/gui/window/win_form.py
@@ -267,7 +267,7 @@ class WinForm(NoModal):
             self.screen.screen_container.alternate_viewport.connect(
                     'key-press-event', self.on_keypress)
 
-        if self.save_current:
+        if self.save_current and not new:
             self.screen.signal_connect(self, 'record-message',
                 self.activate_save)
             self.screen.signal_connect(self, 'record-modified',
diff --git a/tryton/pyson.py b/tryton/pyson.py
index d275d79..4cc9d5d 100644
--- a/tryton/pyson.py
+++ b/tryton/pyson.py
@@ -28,25 +28,25 @@ class PYSON(object):
             return Not(self)
 
     def __and__(self, other):
+        if (isinstance(other, PYSON)
+                and other.types() != set([bool])):
+            other = Bool(other)
         if (isinstance(self, And)
                 and not isinstance(self, Or)):
             self._statements.append(other)
             return self
-        if (isinstance(other, PYSON)
-                and other.types() != set([bool])):
-            other = Bool(other)
         if self.types() != set([bool]):
             return And(Bool(self), other)
         else:
             return And(self, other)
 
     def __or__(self, other):
-        if isinstance(self, Or):
-            self._statements.append(other)
-            return self
         if (isinstance(other, PYSON)
                 and other.types() != set([bool])):
             other = Bool(other)
+        if isinstance(self, Or):
+            self._statements.append(other)
+            return self
         if self.types() != set([bool]):
             return Or(Bool(self), other)
         else:
diff --git a/tryton/version.py b/tryton/version.py
index 2c927dc..ee65cc8 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.13"
+VERSION = "2.6.14"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/"
-- 
tryton-client



More information about the tryton-debian-vcs mailing list