[tryton-debian-vcs] tryton-client branch upstream-3.0 updated. upstream/3.0.7-1-g31a97c9
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-3.0 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-client.git;a=commitdiff;h=upstream/3.0.7-1-g31a97c9
commit 31a97c9fae3dd28daac18a6b0fd58480de5ad828
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Wed Nov 12 12:58:12 2014 +0100
Adding upstream version 3.0.8.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 473df0c..866313b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.8 - 2014-11-06
+* Bug fixes (see mercurial logs for details)
+
Version 3.0.7 - 2014-09-29
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index b53340b..1ce9d82 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tryton
-Version: 3.0.7
+Version: 3.0.8
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 b53340b..1ce9d82 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.0.7
+Version: 3.0.8
Summary: Tryton client
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/tryton/common/domain_parser.py b/tryton/common/domain_parser.py
index 3fbccd6..0296208 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:
@@ -1151,6 +1159,9 @@ def test_group():
('Name', '=', None),
('Name', None, 'Doe'),
]
+ assert rlist(dom.group(udlex(u'Name: \\"foo\\"'))) == [
+ ('Name', None, '"foo"'),
+ ]
def test_parse_clause():
diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py
index c06cb7f..24f803e 100644
--- a/tryton/gui/window/view_form/model/field.py
+++ b/tryton/gui/window/view_form/model/field.py
@@ -875,6 +875,9 @@ class DictField(CharField):
_default = {}
+ def get(self, record):
+ return super(DictField, self).get(record) or self._default
+
def validation_domains(self, record):
screen_domain, attr_domain = self.domains_get(record)
return screen_domain, screen_domain
diff --git a/tryton/gui/window/view_form/model/group.py b/tryton/gui/window/view_form/model/group.py
index 695513f..d90a7be 100644
--- a/tryton/gui/window/view_form/model/group.py
+++ b/tryton/gui/window/view_form/model/group.py
@@ -83,9 +83,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 dfa1895..89b0022 100644
--- a/tryton/gui/window/view_form/screen/screen.py
+++ b/tryton/gui/window/view_form/screen/screen.py
@@ -726,6 +726,9 @@ class Screen(SignalEvent):
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)
@@ -790,7 +793,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 5c11c0d..3750eef 100644
--- a/tryton/gui/window/view_form/view/form_gtk/many2one.py
+++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py
@@ -311,9 +311,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 314bff6..d602903 100644
--- a/tryton/gui/window/win_form.py
+++ b/tryton/gui/window/win_form.py
@@ -263,7 +263,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 5b7bf46..318c30d 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 19e2e7d..3907da9 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.0.7"
+VERSION = "3.0.8"
LICENSE = "GPL-3"
WEBSITE = "http://www.tryton.org/"
--
tryton-client
More information about the tryton-debian-vcs
mailing list