[tryton-debian-vcs] tryton-client branch upstream-3.2 updated. upstream/3.2.4-1-g56e397a
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.2 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-client.git;a=commitdiff;h=upstream/3.2.4-1-g56e397a
commit 56e397a56e030880daa89f92e3e3ed8c56b273fc
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Wed Nov 12 12:59:28 2014 +0100
Adding upstream version 3.2.5.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index be6184e..58c9719 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.5 - 2014-11-06
+* Bug fixes (see mercurial logs for details)
+
Version 3.2.4 - 2014-09-29
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 8bd6c16..c39b148 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: tryton
-Version: 3.2.4
+Version: 3.2.5
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 8bd6c16..c39b148 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.4
+Version: 3.2.5
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 935b245..43ef444 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:
@@ -1284,6 +1292,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/form.py b/tryton/gui/window/form.py
index 76caded..59981eb 100644
--- a/tryton/gui/window/form.py
+++ b/tryton/gui/window/form.py
@@ -273,6 +273,10 @@ class Form(SignalEvent, TabContent):
return
revision = self.screen.context.get('_datetime')
revision = Revision(revisions, revision).run()
+ # Prevent too old revision in form view
+ if (self.screen.current_view.view_type == 'form'
+ and revision < revisions[-1][0]):
+ revision = revisions[-1][0]
if revision != self.screen.context.get('_datetime'):
self.screen.clear()
# Update root group context that will be propagated
diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py
index 452d573..5326645 100644
--- a/tryton/gui/window/view_form/model/field.py
+++ b/tryton/gui/window/view_form/model/field.py
@@ -694,7 +694,7 @@ class O2MField(Field):
fields = {}
to_remove = []
- for record2 in record.value[self.name]:
+ for record2 in record.value.get(self.name, []):
if not record2.id:
to_remove.append(record2)
if value and value.get('remove'):
@@ -905,6 +905,9 @@ class DictField(Field):
_default = {}
+ def get(self, record):
+ return super(DictField, self).get(record) or self._default
+
def get_client(self, record):
return super(DictField, self).get_client(record) or self._default
diff --git a/tryton/gui/window/view_form/model/group.py b/tryton/gui/window/view_form/model/group.py
index cea94f5..91cdbbe 100644
--- a/tryton/gui/window/view_form/model/group.py
+++ b/tryton/gui/window/view_form/model/group.py
@@ -80,9 +80,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 c495db1..82448a1 100644
--- a/tryton/gui/window/view_form/screen/screen.py
+++ b/tryton/gui/window/view_form/screen/screen.py
@@ -722,7 +722,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)
@@ -787,7 +789,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 dd72af3..cc199bc 100644
--- a/tryton/gui/window/view_form/view/form_gtk/many2one.py
+++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py
@@ -316,9 +316,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 dcfef89..4a536e9 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/gui/window/wizard.py b/tryton/gui/window/wizard.py
index 42d625e..398138b 100644
--- a/tryton/gui/window/wizard.py
+++ b/tryton/gui/window/wizard.py
@@ -110,7 +110,7 @@ class Wizard(object):
Action._exec_action(*action, context=self.context.copy())
if self.state == self.end_state:
- self.end(execute_actions)
+ self.end(lambda *a: execute_actions())
else:
execute_actions()
self.__processing = False
diff --git a/tryton/pyson.py b/tryton/pyson.py
index 9f637a5..48c5b15 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 451b8ce..c2920f6 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.4"
+VERSION = "3.2.5"
LICENSE = "GPL-3"
WEBSITE = "http://www.tryton.org/"
--
tryton-client
More information about the tryton-debian-vcs
mailing list