From 827435bdbe3ea41a7675294d660c1634065fce93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 21 Oct 2013 17:33:26 +0200 Subject: [PATCH 01/24] Increase version number --- tryton/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/version.py b/tryton/version.py index 48ab231a89..eb74475aa5 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.0" +VERSION = "3.0.1" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From f0c44dfdc7d572a73d34175aaa5820708a75edaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Nov 2013 18:41:31 +0100 Subject: [PATCH 02/24] Sanitize report file extension issue3446 (transplanted from 357d0a4d9cb8b3f0f4192cb87996a5720bf1cb37) --- CHANGELOG | 2 ++ tryton/action/main.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 20bf42ac37..fc8f44a4ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Sanitize report file extension + Version 3.0.0 - 2013-10-21 * Bug fixes (see mercurial logs for details) * Add factor on number widgets diff --git a/tryton/action/main.py b/tryton/action/main.py index 4913b04b9c..d06afb0052 100644 --- a/tryton/action/main.py +++ b/tryton/action/main.py @@ -42,7 +42,8 @@ class Action(object): dtemp = tempfile.mkdtemp(prefix='tryton_') fp_name = os.path.join(dtemp, name.replace(os.sep, '_').replace(os.altsep or os.sep, '_') - + os.extsep + type) + + os.extsep + + type.replace(os.sep, '_').replace(os.altsep or os.sep, '_')) with open(fp_name, 'wb') as file_d: file_d.write(data) if email_print: From f22250dde2aad5b3b98cb6306327469a98a34e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Nov 2013 18:49:15 +0100 Subject: [PATCH 03/24] Prepare release 3.0.1 --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index fc8f44a4ca..d7104ebb6a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +Version 3.0.1 - 2013-11-03 +* Bug fixes (see mercurial logs for details) * Sanitize report file extension Version 3.0.0 - 2013-10-21 From e34a954bdf30da84613082aa7f02b165350c295a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Nov 2013 18:49:16 +0100 Subject: [PATCH 04/24] Added tag 3.0.1 for changeset 72ae9927485c --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 162ee50f2d..7728b87655 100644 --- a/.hgtags +++ b/.hgtags @@ -9,3 +9,4 @@ fe15da23f7333e0e90d2693aadddf6bed53ed602 2.4.0 d069f9f1cdc3fea39e71415268582abb2b333ea1 2.6.0 21fbf8bd36096d926c472acfecd3963369204af8 2.8.0 9197d90b0257ec7c4576a38092fd592b3e87f7a4 3.0.0 +72ae9927485c0fc1d94f7f0377a15d5276eb0af1 3.0.1 From 08675f77c5ed02b813cd9969a57a5147c9669c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Nov 2013 18:49:42 +0100 Subject: [PATCH 05/24] Increase version number --- tryton/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/version.py b/tryton/version.py index eb74475aa5..b21c548acb 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.1" +VERSION = "3.0.2" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From 8f7b93632413ab3c91d1cf6056df9fd01eb78fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 27 Oct 2013 19:25:31 +0100 Subject: [PATCH 06/24] Convert to unicode the string of predefined search field DomainParser expect to work with unicode and gettext return string encoded in utf-8 (coding of the po file) issue3440 review1301002 (transplanted from 2bbb22151fc09ecbc9da17302def0fa111eb620f) --- tryton/gui/window/view_form/screen/screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index 3e5a7455b4..b290951e40 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -140,7 +140,7 @@ class Screen(SignalEvent): ): if name not in fields: fields[name] = { - 'string': string, + 'string': string.decode('utf-8'), 'name': name, 'type': type_, } From 2577d8a335cca65a6b02c1c587de1e8455607990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 30 Oct 2013 00:38:41 +0100 Subject: [PATCH 07/24] Dict widget must use rec_name to search key review1401002 (transplanted from c909bd88517dc3752017b700901fe3d4a2ff2674) --- tryton/gui/window/view_form/view/form_gtk/dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/dictionary.py b/tryton/gui/window/view_form/view/form_gtk/dictionary.py index 42090b8ff3..56f49a9802 100644 --- a/tryton/gui/window/view_form/view/form_gtk/dictionary.py +++ b/tryton/gui/window/view_form/view/form_gtk/dictionary.py @@ -481,7 +481,7 @@ class DictWidget(WidgetInterface): context = self.field.context_get(self.record) try: key_ids = RPCExecute('model', self.schema_model, 'search', - [('name', '=', key)], 0, CONFIG['client.limit'], + [('rec_name', '=', key)], 0, CONFIG['client.limit'], None, context=context) self.keys[key] = RPCExecute('model', self.schema_model, 'get_keys', key_ids, context=context)[0] From e2b9f8dddd674a43e94e442bcd35b9004a3708b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Nov 2013 20:37:43 +0100 Subject: [PATCH 08/24] Missing GooCalendar optional dependency in doc (transplanted from f9943aa0194d79894f424d85fc9f8227b81de701) --- doc/installation.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/installation.rst b/doc/installation.rst index 7003d51660..14ecd9c300 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -12,6 +12,7 @@ Prerequisites * Optional: simplejson (http://undefined.org/python/#simplejson) * Optional: pytz (http://pytz.sourceforge.net/) * Optional: cdecimal (http://www.bytereef.org/mpdecimal/index.html) + * Optional: GooCalendar (http://code.google.com/p/goocalendar/) Installation ------------ From 904e4d24cd5938463b9eafb291365b6cbbf73030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Nov 2013 20:42:34 +0100 Subject: [PATCH 09/24] Don't set image on button if it is still the same It fixes also a strange behavior of GTK that doesn't display any images if the icon is changed before it is realized. issue3191 review1451002 (transplanted from 4bc44691dc89dfd7802c9d84bbb466f98038bb75) --- tryton/common/button.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tryton/common/button.py b/tryton/common/button.py index f4e07aab6f..67a51907bb 100644 --- a/tryton/common/button.py +++ b/tryton/common/button.py @@ -17,6 +17,11 @@ class Button(gtk.Button): self._set_icon(attrs.get('icon')) def _set_icon(self, stock): + image = self.get_image() + if not image and not stock: + return + elif image and image.get_stock()[0] == stock: + return if not stock: self.set_image(gtk.Image()) return From 3e9aca2d09640fecebd0cafe2aefa907c319ce4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 12 Nov 2013 16:45:42 +0100 Subject: [PATCH 10/24] Backed out changeset c909bd88517d Using rec_name to search key is wrong because rec_name is the string and not the key. issue3483 (transplanted from a674398cccb4b47ccabe34a2f1ea00e3d8fd6b53) --- tryton/gui/window/view_form/view/form_gtk/dictionary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/dictionary.py b/tryton/gui/window/view_form/view/form_gtk/dictionary.py index 56f49a9802..42090b8ff3 100644 --- a/tryton/gui/window/view_form/view/form_gtk/dictionary.py +++ b/tryton/gui/window/view_form/view/form_gtk/dictionary.py @@ -481,7 +481,7 @@ class DictWidget(WidgetInterface): context = self.field.context_get(self.record) try: key_ids = RPCExecute('model', self.schema_model, 'search', - [('rec_name', '=', key)], 0, CONFIG['client.limit'], + [('name', '=', key)], 0, CONFIG['client.limit'], None, context=context) self.keys[key] = RPCExecute('model', self.schema_model, 'get_keys', key_ids, context=context)[0] From 56428a1901a8b6d19345b70bd4d6ab192add44a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 14 Nov 2013 18:49:47 +0100 Subject: [PATCH 11/24] Fix wrong instantiation of Attachment Introduced with changeset 60c08c72a159 issue3481 review1621003 (transplanted from 41b73cb9e9fe927fe2e71710c83a9286f0d38f6a) --- tryton/common/popup_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/common/popup_menu.py b/tryton/common/popup_menu.py index ac69109a24..4b4e743c1c 100644 --- a/tryton/common/popup_menu.py +++ b/tryton/common/popup_menu.py @@ -52,7 +52,7 @@ def populate(menu, model, record, title=''): Action._exec_action(action, data, {}) def attachment(menuitem): - Attachment(model, load(record).id, None) + Attachment(record, None) if title: if len(menu): From f7d7d6043c8b378a1412c1dfbc809f2fa4859f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Fri, 15 Nov 2013 15:03:00 +0100 Subject: [PATCH 12/24] Use get_eval for check_required computation issue3473 review1561002 (transplanted from 4786286136344caf3e4bda27c23ac1ab911d9380) --- tryton/gui/window/view_form/model/field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py index 12966cafa2..c4a7a2e765 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -77,7 +77,7 @@ class CharField(object): def check_required(self, record): state_attrs = self.get_state_attrs(record) if bool(int(state_attrs.get('required') or 0)): - if (not self.get(record) + if (not self.get_eval(record) and not bool(int(state_attrs.get('readonly') or 0))): return False return True From d089dbf8e08d556790a37790bb413cbf98b2d366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 16 Nov 2013 19:00:14 +0100 Subject: [PATCH 13/24] Search limit must be int Since usage of python-sql limit is enforced to only integer. issue3484 review1691002 (transplanted from 8633dabbbabd0f36bf8f2cfa07a44e6db991b368) --- tryton/config.py | 4 +++- tryton/gui/window/limit.py | 10 +++++----- tryton/gui/window/view_form/model/record.py | 2 +- tryton/gui/window/view_form/screen/screen.py | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tryton/config.py b/tryton/config.py index ac9763de4e..a20aba8f62 100644 --- a/tryton/config.py +++ b/tryton/config.py @@ -155,7 +155,9 @@ class ConfigManager(object): elif value.lower() == 'false': value = False if section == 'client' and name == 'limit': - value = float(value) + # First convert to float to be backward compatible with old + # configuration + value = int(float(value)) self.config[section + '.' + name] = value return True diff --git a/tryton/gui/window/limit.py b/tryton/gui/window/limit.py index b0501e8131..af4797a09d 100644 --- a/tryton/gui/window/limit.py +++ b/tryton/gui/window/limit.py @@ -27,11 +27,11 @@ class Limit(object): self.win.vbox.pack_start(gtk.HSeparator()) hbox = gtk.HBox(spacing=3) hbox.pack_start(gtk.Label(_('Limit:')), expand=True, fill=True) - self.spin_limit = gtk.SpinButton(climb_rate=1, digits=0) + adjustment = gtk.Adjustment(value=CONFIG['client.limit'], + lower=1, upper=sys.maxint, step_incr=10, page_incr=100) + self.spin_limit = gtk.SpinButton(adjustment, climb_rate=1, digits=0) self.spin_limit.set_numeric(False) - self.spin_limit.set_adjustment(gtk.Adjustment( - value=CONFIG['client.limit'], lower=1, upper=sys.maxint, - step_incr=10, page_incr=100)) + self.spin_limit.set_activates_default(True) hbox.pack_start(self.spin_limit, expand=True, fill=True) self.win.vbox.pack_start(hbox, expand=True, fill=True) @@ -41,7 +41,7 @@ class Limit(object): 'Run the window' res = self.win.run() if res == gtk.RESPONSE_OK: - CONFIG['client.limit'] = self.spin_limit.get_value() + CONFIG['client.limit'] = self.spin_limit.get_value_as_int() CONFIG.save() self.parent.present() self.win.destroy() diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index 83bcdd4621..e17da08d99 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -73,7 +73,7 @@ class Record(SignalEvent): record_context = self.context_get() if loading == 'eager': - limit = int(CONFIG['client.limit']) + limit = CONFIG['client.limit'] if not self.parent: # If not a children no need to load too much limit = int(limit / len(fnames)) diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index b290951e40..37923e3e8d 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -53,7 +53,7 @@ class Screen(SignalEvent): if domain is None: domain = [] - self.limit = limit or int(CONFIG['client.limit']) + self.limit = limit or CONFIG['client.limit'] self.offset = 0 super(Screen, self).__init__() From 6ceb494c7949a5fdd12a02aa9f023256024f401f Mon Sep 17 00:00:00 2001 From: Robin Baumgartner Date: Wed, 20 Nov 2013 08:33:58 +0100 Subject: [PATCH 14/24] Send None for missing parent records instead of False issue3448 review1761002 (transplanted from 207e9ee40735a5f9a37b796807f5f56189d25dba) --- tryton/gui/window/view_form/model/record.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index e17da08d99..35a08b1c93 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -514,7 +514,7 @@ class Record(SignalEvent): scope = values for i in arg.split('.'): if i not in scope: - scope = False + scope = None break scope = scope[i] res[arg] = scope From 629bef159c92059d8e765fe183a6cb9934d5fcf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 4 Dec 2013 16:56:39 +0100 Subject: [PATCH 15/24] Prepare release 3.0.2 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d7104ebb6a..85ce572437 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 3.0.2 - 2013-12-04 +* Bug fixes (see mercurial logs for details) + Version 3.0.1 - 2013-11-03 * Bug fixes (see mercurial logs for details) * Sanitize report file extension From 25acb5580cf6cd3753ef134e918c46d848749c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 4 Dec 2013 16:56:40 +0100 Subject: [PATCH 16/24] Added tag 3.0.2 for changeset 1fe4de1d4830 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 7728b87655..786f7713f0 100644 --- a/.hgtags +++ b/.hgtags @@ -10,3 +10,4 @@ d069f9f1cdc3fea39e71415268582abb2b333ea1 2.6.0 21fbf8bd36096d926c472acfecd3963369204af8 2.8.0 9197d90b0257ec7c4576a38092fd592b3e87f7a4 3.0.0 72ae9927485c0fc1d94f7f0377a15d5276eb0af1 3.0.1 +1fe4de1d48301213dd9ffeaa8eec82be0fa21317 3.0.2 From afcd30d1c543c72e6aca141f841d1cc66ee14b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 4 Dec 2013 16:57:05 +0100 Subject: [PATCH 17/24] Increase version number --- tryton/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/version.py b/tryton/version.py index b21c548acb..0158ec3eda 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.2" +VERSION = "3.0.3" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From 1035c280513f686034a5d9bf7d1efce18bd747d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 9 Jan 2014 18:44:16 +0100 Subject: [PATCH 18/24] Fix reload of screen at the end of wizard A wizard could be launch by a button defined on a children record. In this case, the ids to reload is not the ids from the wizard as they are from the children model but just the current record. issue3519 review2571002 (transplanted from 6f657eeefffcc5a74be70e7cc8868fc7293d3c44) --- tryton/gui/window/wizard.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tryton/gui/window/wizard.py b/tryton/gui/window/wizard.py index a910de4997..869ec06f98 100644 --- a/tryton/gui/window/wizard.py +++ b/tryton/gui/window/wizard.py @@ -350,9 +350,13 @@ class WizardDialog(Wizard, NoModal): dialog = self.page if (hasattr(dialog, 'screen') and dialog.screen.current_record - and self.sensible_widget != main.window - and self.ids): - dialog.screen.reload(self.ids, written=True) + and self.sensible_widget != main.window): + if dialog.screen.model_name == self.model: + ids = self.ids + else: + # Wizard run from a children record so reload parent record + ids = [dialog.screen.current_record.id] + dialog.screen.reload(ids, written=True) def end(self): super(WizardDialog, self).end() From 92e4a3687931d13de83d81aac5d95f8d2e176119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 9 Jan 2014 18:45:14 +0100 Subject: [PATCH 19/24] Force value of parent Reference field Since 2.6, reference field can be used in One2Many so in this case the value should be forced like for Many2One. review2581002 (transplanted from 67acb340ba7caf7f6c801e2c7af6884e6603b614) --- tryton/gui/window/view_form/model/field.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py index c4a7a2e765..e4e47a5cf6 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -779,6 +779,12 @@ class ReferenceField(CharField): return None def get(self, record): + if record.parent_name == self.name: + if record.parent: + return '%s,%s' % (record.group.parent.model_name, + record.parent.id) + else: + return None if (record.value.get(self.name) and record.value[self.name][0] and record.value[self.name][1] >= -1): From 15d9dbf53b832d0fe417034b07c3d8e64a38d35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 26 Jan 2014 22:17:03 +0100 Subject: [PATCH 20/24] Encode gettext value to match with string value issue3587 review2991002 (transplanted from 80a479e15e31f5a97eaf26ddbd3f9a89303c595e) --- tryton/common/domain_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/common/domain_parser.py b/tryton/common/domain_parser.py index e17be8d98a..3fbccd6fa8 100644 --- a/tryton/common/domain_parser.py +++ b/tryton/common/domain_parser.py @@ -184,7 +184,7 @@ def convert_value(field, value): def convert_boolean(): if isinstance(value, basestring): - return any(test.lower().startswith(value.lower()) + return any(test.decode('utf-8').lower().startswith(value.lower()) for test in (_('y'), _('yes'), _('true'), _('t'), '1')) else: return bool(value) From 8f0f882fc048be2ec0332b5633103d7dd8a6c991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 6 Feb 2014 22:36:44 +0100 Subject: [PATCH 21/24] Fix find button in search window It should use the text filled in the search entry. And it should not close the window if nothing is found. review3101003 (transplanted from 8b22f7366f7caeb7ecbe86c28b8b4f8f3bf32627) --- tryton/gui/window/win_search.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tryton/gui/window/win_search.py b/tryton/gui/window/win_search.py index 388b1e0ba8..cc5e1cb057 100644 --- a/tryton/gui/window/win_search.py +++ b/tryton/gui/window/win_search.py @@ -109,10 +109,8 @@ class WinSearch(NoModal): if response_id == gtk.RESPONSE_OK: res = self.screen.sel_ids_get() elif response_id == gtk.RESPONSE_APPLY: - if not self.screen.search_filter(): - res = self.screen.sel_ids_get() - else: - return + self.screen.search_filter(self.screen.screen_container.get_text()) + return elif response_id == gtk.RESPONSE_ACCEPT: screen = Screen(self.model_name, domain=self.domain, context=self.context, mode=['form']) From 21a6c0f9d44d083d72d6baa54f11dd96299ad7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Feb 2014 23:54:56 +0100 Subject: [PATCH 22/24] Don't set missing default value to False False is not always a good valid value for the field, so it is better to let the field dealing with default value. issue3643 review3281002 (transplanted from 9a16381241f48ca880e7544edeef54c255c99255) --- tryton/gui/window/view_form/model/group.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tryton/gui/window/view_form/model/group.py b/tryton/gui/window/view_form/model/group.py index 145e9f94b1..695513f3ef 100644 --- a/tryton/gui/window/view_form/model/group.py +++ b/tryton/gui/window/view_form/model/group.py @@ -398,9 +398,6 @@ class Group(SignalEvent, list): to_add.keys(), main_iteration=False, context=self.context) except RPCException: return False - for name in to_add: - if name not in values: - values[name] = False for record in new: record.set_default(values, signal=signal) From 21ab3339795e7c32948c6204b15b7fa5cf4efce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Feb 2014 23:56:27 +0100 Subject: [PATCH 23/24] Fix selection of column in next/previous When _sign is negative, it doesn't select the first column but the second. So despite of selection the wrong column, it could crash if there is only one column in the view. review3241004 (transplanted from f05cc122d3fd52141386f8097d0fc3989b85abd4) --- tryton/gui/window/view_form/view/list_gtk/editabletree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/list_gtk/editabletree.py b/tryton/gui/window/view_form/view/list_gtk/editabletree.py index 319fe6c0b9..50b660c8df 100644 --- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py +++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py @@ -21,7 +21,7 @@ class TreeView(gtk.TreeView): def next_column(self, path, column=None, editable=True, _sign=1): columns = self.get_columns() if column is None: - column = columns[-1 * _sign] + column = columns[-1 if _sign > 0 else 0] model = self.get_model() record = model.get_value(model.get_iter(path), 0) if _sign < 0: From 74a333f61fe8be42a4b2c64663f3816e159c7d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Feb 2014 23:57:24 +0100 Subject: [PATCH 24/24] Fix dynamic size for translate widget Dynamic size was added in changeset 8ee7e142c8fd but the translate widget was not updated. review3271004 (transplanted from 1a9e84ba4d48a8e2ca2a98680e2bff1c66aa7791) --- tryton/gui/window/view_form/view/form_gtk/char.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 55d93273ce..50fbad40c5 100644 --- a/tryton/gui/window/view_form/view/form_gtk/char.py +++ b/tryton/gui/window/view_form/view/form_gtk/char.py @@ -49,8 +49,10 @@ class Char(WidgetInterface, TranslateMixin): def translate_widget(self): entry = gtk.Entry() entry.set_property('activates_default', True) - entry.set_width_chars(int(self.attrs.get('size', -1))) - entry.set_max_length(int(self.attrs.get('size', 0))) + if self.record: + field_size = self.record.expr_eval(self.attrs.get('size')) + entry.set_width_chars(field_size or -1) + entry.set_max_length(field_size or 0) return entry @staticmethod