From a1885de56d58e1fd666336c4f09993c968a741f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 2 Nov 2010 13:33:19 +0100 Subject: [PATCH 01/87] 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 dbde801996..3ff7affdb6 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.0" +VERSION = "1.8.1" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From 74f7d6552c58bc168683f1d93aedcd95e5c0d30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 13 Nov 2010 21:41:29 +0100 Subject: [PATCH 02/87] Add missing context in rpc call of sig_logs (transplanted from 729b8d5a31c410abc333d432b26b05183ac386b9) --- tryton/gui/window/form.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py index 8024d36ffb..a635a50bec 100644 --- a/tryton/gui/window/form.py +++ b/tryton/gui/window/form.py @@ -250,7 +250,10 @@ class Form(SignalEvent): ('write_date', _('Latest Modification Date:')), ] - args = ('model', self.model, 'read', [obj_id], [x[0] for x in fields]) + ctx = self.context.copy() + ctx.update(rpc.CONTEXT) + args = ('model', self.model, 'read', [obj_id], [x[0] for x in fields], + ctx) try: res = rpc.execute(*args) except Exception, exception: From 09eebefcdef44ecb27fcb759675f764643ecaaab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 23 Nov 2010 22:25:43 +0100 Subject: [PATCH 03/87] Add missing context in call import_data for issue1765 (transplanted from 88cf190fa90f1cf6d68887373da0662781856dbc) --- tryton/gui/window/win_import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/win_import.py b/tryton/gui/window/win_import.py index b124af32a7..4733a2dde1 100644 --- a/tryton/gui/window/win_import.py +++ b/tryton/gui/window/win_import.py @@ -352,7 +352,8 @@ class WinImport(object): datas.append([x.decode(csv_data['combo']).encode('utf-8') \ for x in line]) try: - res = rpc.execute('model', model, 'import_data', fields, datas) + res = rpc.execute('model', model, 'import_data', fields, datas, + rpc.CONTEXT) except Exception, exception: common.process_exception(exception, self.dialog) return False From db29481f8b55440ca38fb53bbe349d4a9ad15274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 Dec 2010 22:41:30 +0100 Subject: [PATCH 04/87] Fix D&D as field is defined on group no more on record (transplanted from 23eabfd945b827b5583a09ad0b77308554d23378) --- tryton/gui/window/view_form/view/list.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index dd75a7e386..816639fef3 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -368,8 +368,9 @@ class ViewList(ParserView): info, etime): treeview.emit_stop_by_name('drag-data-received') if treeview.sequence: + field = self.screen.group.fields[treeview.sequence] for record in self.screen.group: - if record[treeview.sequence].get_state_attrs( + if field.get_state_attrs( record).get('readonly', False): return if not selection.data: From 103b224956f7964a00b1a9ca2eaf6ac3f2085c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 27 Dec 2010 16:51:59 +0100 Subject: [PATCH 05/87] view could be closed during action execution for issue1791 (transplanted from 19de7633e9acb14b8c87d606daaca944bf9121a8) --- tryton/gui/window/view_form/view/form.py | 3 ++- tryton/gui/window/view_form/view/list.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/form.py b/tryton/gui/window/view_form/view/form.py index 3250d357fc..a8cbe2d03d 100644 --- a/tryton/gui/window/view_form/view/form.py +++ b/tryton/gui/window/view_form/view/form.py @@ -143,7 +143,8 @@ class ViewForm(ParserView): } value = Action._exec_action(act, self.window, data, {}) if atype in ('print', 'action'): - self.screen.reload(writen=True) + if self.screen: + self.screen.reload(writen=True) return value def __getitem__(self, name): diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 816639fef3..a831e50350 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -281,7 +281,8 @@ class ViewList(ParserView): 'ids': obj_ids, } value = Action._exec_action(act, self.window, data, {}) - self.screen.reload(writen=True) + if self.screen: + self.screen.reload(writen=True) return value From aee2c33bab23532a0c749ef6fa77824309e42e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 31 Dec 2010 12:33:22 +0100 Subject: [PATCH 06/87] Prevent popups of many password windows for issue1768 (transplanted from f533cc8bac7cd585a888e1f74a2a05ff95146ec4) --- tryton/common/common.py | 48 ++++++++++++--------- tryton/gui/window/view_form/model/record.py | 2 - 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index 33e90f705e..035a716d57 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -32,6 +32,7 @@ try: except ImportError: ssl = None import dis +from threading import Lock _ = gettext.gettext @@ -801,6 +802,8 @@ This record has been modified while you were editing it. parent, context, ['form', 'tree']) return False +PLOCK = Lock() + def process_exception(exception, parent, *args): global _USERNAME, _DATABASE, _SOCK if str(exception.args[0]) == 'BadFingerprint': @@ -815,28 +818,33 @@ def process_exception(exception, parent, *args): message(_('Connection error!\n' \ 'Unable to connect to the server!'), parent) return False + if not PLOCK.acquire(False): + return False hostname = rpc._SOCK.hostname port = rpc._SOCK.port - while True: - password = ask(_('Password:'), parent, visibility=False) - if password is None: - raise Exception('NotLogged') - res = rpc.login(rpc._USERNAME, password, hostname, port, - rpc._DATABASE) - from tryton.gui.main import Main - Main.get_main().refresh_ssl() - if res == -1: - message(_('Connection error!\n' \ - 'Unable to connect to the server!'), parent) - return False - if res < 0: - continue - if args: - try: - return rpc.execute(*args) - except Exception, exception: - return process_exception(exception, parent, *args) - return True + try: + while True: + password = ask(_('Password:'), parent, visibility=False) + if password is None: + raise Exception('NotLogged') + res = rpc.login(rpc._USERNAME, password, hostname, port, + rpc._DATABASE) + from tryton.gui.main import Main + Main.get_main().refresh_ssl() + if res == -1: + message(_('Connection error!\n' \ + 'Unable to connect to the server!'), parent) + return False + if res < 0: + continue + if args: + try: + return rpc.execute(*args) + except Exception, exception: + return process_exception(exception, parent, *args) + return True + finally: + PLOCK.release() if exception.args[0] == 'ConcurrencyException': if len(args) >= 6: diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index 8ae3ead0b3..3312d6d82d 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -102,8 +102,6 @@ class Record(SignalEvent): except Exception, exception: values = common.process_exception(exception, self.window, *args) if not values: - log = logging.getLogger('record') - log.error('%s' % exception.args[-1]) values = [{'id': x} for x in ids] id2value = dict((value['id'], value) for value in values) if ids != [self.id]: From 2c3449d4099905fca1ac1c1b6e8385e059a2d30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Jan 2011 22:15:03 +0100 Subject: [PATCH 07/87] Add synchronization of missing size attribute between field and view for issue1801 (transplanted from 9367c61d106a647de01fff9a8f2e7be878dc7cfc) --- tryton/gui/window/view_form/view/form_gtk/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/parser.py b/tryton/gui/window/view_form/view/form_gtk/parser.py index 12318c8e85..8fe3fd37c6 100644 --- a/tryton/gui/window/view_form/view/form_gtk/parser.py +++ b/tryton/gui/window/view_form/view/form_gtk/parser.py @@ -518,7 +518,7 @@ class ParserForm(ParserInterface): continue for attr_name in ('relation', 'domain', 'selection', 'relation_field', 'string', 'views', 'invisible', - 'add_remove', 'sort', 'context'): + 'add_remove', 'sort', 'context', 'size'): if attr_name in fields[name].attrs and \ not attr_name in attrs: attrs[attr_name] = fields[name].attrs[attr_name] From cd04e507062b1b65a62e25a96819e1573c1a1e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 13 Jan 2011 11:33:58 +0100 Subject: [PATCH 08/87] Add missing context to default_get call for issue1819 (transplanted from 3814ab387ce8799bebb881578879d331907a2b82) --- tryton/gui/window/view_form/view/form_gtk/interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/interface.py b/tryton/gui/window/view_form/view/form_gtk/interface.py index adb54fbaa0..08d6db1f1b 100644 --- a/tryton/gui/window/view_form/view/form_gtk/interface.py +++ b/tryton/gui/window/view_form/view/form_gtk/interface.py @@ -108,7 +108,8 @@ class WidgetInterface(object): if self.field.get_state_attrs(self.record).get('readonly', False): return False model_name = self.field.parent.model_name - args = ('model', model_name, 'default_get', [self.attrs['name']]) + args = ('model', model_name, 'default_get', [self.attrs['name']], + rpc.CONTEXT) try: res = rpc.execute(*args) except Exception, exception: From ed0ef05becc2b70f6760e4eb0ce90f69e141fc52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 16 Jan 2011 22:18:27 +0100 Subject: [PATCH 09/87] Return Decimal value for numeric search for issue1805 (transplanted from 6dcc64647e04d84180e7db50e4e86f99335c3fb8) --- .../window/view_form/widget_search/float.py | 21 +++++++++++++++++++ .../window/view_form/widget_search/form.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/widget_search/float.py b/tryton/gui/window/view_form/widget_search/float.py index 6ef522ad6e..9b6966d8b3 100644 --- a/tryton/gui/window/view_form/widget_search/float.py +++ b/tryton/gui/window/view_form/widget_search/float.py @@ -1,6 +1,7 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. import locale +from decimal import Decimal from integer import Integer import gettext @@ -66,3 +67,23 @@ class Float(Integer): widget.stop_emission('insert-text') except Exception: widget.stop_emission('insert-text') + + +class Numeric(Float): + + def _value_get(self): + try: + value1 = Decimal(str(locale.atof(self.entry1.get_text()))) + except Exception: + value1 = False + try: + value2 = Decimal(str(locale.atof(self.entry2.get_text()))) + except Exception: + value2 = False + res = self._get_clause(value1, value2) + return res + + def _value_set(self, value): + super(Numeric, self)._value_set(value) + + value = property(_value_get, _value_set) diff --git a/tryton/gui/window/view_form/widget_search/form.py b/tryton/gui/window/view_form/widget_search/form.py index 73f9f9243a..166f6f26e3 100644 --- a/tryton/gui/window/view_form/widget_search/form.py +++ b/tryton/gui/window/view_form/widget_search/form.py @@ -298,7 +298,7 @@ WIDGETS_TYPE = { 'date': (calendar.Calendar, 2), 'datetime': (calendar.Calendar, 2), 'float': (float.Float, 2), - 'numeric': (float.Float, 2), + 'numeric': (float.Numeric, 2), 'integer': (integer.Integer, 2), 'biginteger': (integer.Integer, 2), 'selection': (selection.Selection, 2), From d752547cf508494382fef05e0e82254455be1d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 16 Jan 2011 22:28:54 +0100 Subject: [PATCH 10/87] Allow clean destroy of view with more than one widget for xxx2many fields for issue1823 (transplanted from e771d7944ef2f03c43672dee3ffec50ef30ddc36) --- tryton/gui/window/view_form/model/group.py | 2 +- tryton/signal_event.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/model/group.py b/tryton/gui/window/view_form/model/group.py index 77ffd8da9c..1c199d7bf8 100644 --- a/tryton/gui/window/view_form/model/group.py +++ b/tryton/gui/window/view_form/model/group.py @@ -341,7 +341,7 @@ class Group(SignalEvent, list): self.parent = None for field in self.fields.itervalues(): field.destroy() - self.fields = None + self.fields = {} self.record_removed = None self.record_deleted = None self.__id2record = None diff --git a/tryton/signal_event.py b/tryton/signal_event.py index aeff3eb04c..2c6de8c79b 100644 --- a/tryton/signal_event.py +++ b/tryton/signal_event.py @@ -38,4 +38,4 @@ class SignalEvent(object): return True def destroy(self): - self.__connects = None + self.__connects = {} From f2742d18c49d052998b2c198764aafd7ab67af6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 28 Jan 2011 10:52:53 +0100 Subject: [PATCH 11/87] Destroy the dialog after reading value of the widget for issue1837 And call present on the parent window (transplanted from 9ccf31fb4b4350d418a55ba08f1811610da9aa4d) --- tryton/gui/window/form.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py index a635a50bec..0ed7ffee24 100644 --- a/tryton/gui/window/form.py +++ b/tryton/gui/window/form.py @@ -192,9 +192,10 @@ class Form(SignalEvent): win.show_all() response = win.run() - win.destroy() if response == gtk.RESPONSE_OK: self.screen.display(locale.atoi(entry.get_text()), set_cursor=True) + win.destroy() + self.window.present() def destroy(self): self.screen.signal_unconnect(self) From 11f23ae7298bfbcb2f7c1cde93c7a511550f4639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Thu, 27 Jan 2011 15:59:32 +0100 Subject: [PATCH 12/87] Fix typo (transplanted from 5e25e07e4764fb581dbce29beb6b942e8bd19cc2) --- tryton/gui/window/view_form/view/list_gtk/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 efbbd002f9..61ba28e273 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -824,7 +824,7 @@ class ProgressBar(object): class Button(object): - def __init__(self, treeview, windown, screen, attrs=None): + def __init__(self, treeview, window, screen, attrs=None): super(Button, self).__init__() self.attrs = attrs or {} self.renderer = CellRendererButton(attrs.get('string', _('Unknown'))) From eff32a3c79ecbe3452cee2c83ad3d9d4c10576c0 Mon Sep 17 00:00:00 2001 From: Korbinian Preisler Date: Fri, 28 Jan 2011 09:56:39 +0100 Subject: [PATCH 13/87] add missing context in rpc call of window wizard creation for issue1842 (transplanted from 8deb3010f9a00331384e0effbcdc2bb234ce6838) --- tryton/gui/window/wizard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/wizard.py b/tryton/gui/window/wizard.py index 6e412c9497..bda7d081c9 100644 --- a/tryton/gui/window/wizard.py +++ b/tryton/gui/window/wizard.py @@ -48,7 +48,7 @@ class Wizard(SignalEvent): self.context = context if not 'form' in datas: datas['form'] = {} - args = ('wizard', action, 'create') + args = ('wizard', action, 'create', rpc.CONTEXT) try: self.wiz_id = rpc.execute(*args) except Exception, exception: From 15aeffa470f3b9afda0c05916e538eacaf126b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 7 Feb 2011 23:22:24 +0100 Subject: [PATCH 14/87] Fix typo for issue1853 (transplanted from 4b7ca6a18fd84c5e6b5cfe1ef739dc826f5e326e) --- 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 3312d6d82d..71525d09f7 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -399,7 +399,7 @@ class Record(SignalEvent): elif isinstance(self.group.fields[fieldname], field.ReferenceField): if value: - ref_mode, ref_id = value.split(',', 1) + ref_model, ref_id = value.split(',', 1) if fieldname + '.rec_name' in res: value = ref_model, (ref_id, res[fieldname + '.rec_name']) From 79209de25760bddfd5f0251e87faa6e8d1b2994e Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 13 Feb 2011 16:30:24 +0100 Subject: [PATCH 15/87] Update COPYRIGHT --- COPYRIGHT | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 1a619f1e33..f98ae5c521 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,8 +1,8 @@ -Copyright (C) 2007-2010 Cédric Krier. -Copyright (C) 2007-2010 Bertrand Chenal. -Copyright (C) 2008-2010 B2CK SPRL. -Copyright (C) 2008-2010 Udo Spallek. -Copyright (C) 2008-2010 virtual things - Preisler & Spallek GbR. +Copyright (C) 2007-2011 Cédric Krier. +Copyright (C) 2007-2011 Bertrand Chenal. +Copyright (C) 2008-2011 B2CK SPRL. +Copyright (C) 2008-2011 Udo Spallek. +Copyright (C) 2008-2011 virtual things - Preisler & Spallek GbR. Copyright (C) 2004-2008 Tiny SPRL. This program is free software: you can redistribute it and/or modify From 96827b7e6daa02145ec0d31ca3bef3c17a26c06e Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 13 Feb 2011 17:32:31 +0100 Subject: [PATCH 16/87] Prepare release 1.8.1 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index e7cbfa3694..9389b626cf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.1 - 2011-02-13 +* Bug fixes (see mercurial logs for details) + Version 1.8.0 - 2010-11-01 * Bug fixes (see mercurial logs for details) * More fully integrate GTK menubar for Mac OS From e5eea0b1e2524913b6a58200cc6bc41bcda52c08 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 13 Feb 2011 17:32:31 +0100 Subject: [PATCH 17/87] Added tag 1.8.1 for changeset ea11660a036c --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 47f5f044df..279c7f3eb3 100644 --- a/.hgtags +++ b/.hgtags @@ -3,3 +3,4 @@ de84c1443d4bad908eabb99c381578b988c2117f 1.4.0 3976912b23dfc5db2525d4c2e55d17f099d9492d 1.6.0 8aa050da53cbdfabe1353a37da91c011b7fff549 1.8.0 +ea11660a036ce298897045a00f3ed605b41e318a 1.8.1 From 1581ed3287af40ba276d48068f1ec774e1894af8 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 13 Feb 2011 17:33:02 +0100 Subject: [PATCH 18/87] 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 3ff7affdb6..a49fe66ac0 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.1" +VERSION = "1.8.2" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From 68008b2d9360fda80d78a84f0b0b785d254858c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 10 Feb 2011 11:04:10 +0100 Subject: [PATCH 19/87] Domain in selection must be PYSON decoded (transplanted from 9c544ce5e67e28ff9571b985b289ef01c5b80af0) --- tryton/gui/window/view_form/view/list_gtk/parser.py | 9 ++++++--- .../gui/window/view_form/widget_search/selection.py | 12 ++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) 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 61ba28e273..a782175f1f 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -678,10 +678,13 @@ class Selection(Char): selection_data = gtk.ListStore(str, str) selection = self.attrs.get('selection', [])[:] self.selection = selection[:] + if not self.attrs.get('domain'): + domain = [] + else: + domain = PYSONDecoder(rpc.CONTEXT).decode(self.attrs['domain']) if 'relation' in self.attrs: args = ('model', self.attrs['relation'], 'search_read', - self.attrs.get('domain', []), 0, None, None, ['rec_name'], - rpc.CONTEXT) + domain, 0, None, None, ['rec_name'], rpc.CONTEXT) try: result = rpc.execute(*args) except Exception, exception: @@ -700,7 +703,7 @@ class Selection(Char): selection = [] self.selection = selection[:] - for dom in common.filter_domain(self.attrs.get('domain', [])): + for dom in common.filter_domain(domain): if dom[1] in ('=', '!='): todel = [] for i in xrange(len(selection)): diff --git a/tryton/gui/window/view_form/widget_search/selection.py b/tryton/gui/window/view_form/widget_search/selection.py index 931fe506f7..ecda05ea40 100644 --- a/tryton/gui/window/view_form/widget_search/selection.py +++ b/tryton/gui/window/view_form/widget_search/selection.py @@ -6,6 +6,7 @@ import tryton.rpc as rpc import tryton.common as common import gobject import gettext +from tryton.pyson import PYSONDecoder _ = gettext.gettext @@ -40,11 +41,14 @@ class Selection(Interface): self._selection = {} selection = self.attrs.get('selection', []) if 'relation' in self.attrs: + if not self.attrs.get('domain'): + domain = [] + else: + domain = PYSONDecoder(rpc.CONTEXT).decode(self.attrs['domain']) try: - result = rpc.execute('model', - self.attrs['relation'], 'search_read', - self.attrs.get('domain', []), - 0, None, None, ['rec_name'], rpc.CONTEXT) + result = rpc.execute('model', self.attrs['relation'], + 'search_read', domain, 0, None, None, + ['rec_name'], rpc.CONTEXT) selection = [(x['id'], x['rec_name']) for x in result] except Exception, exception: common.process_exception(exception, parent) From e77316b674e34f56e463e14043182b3b1f2b4b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Mon, 7 Feb 2011 18:14:58 +0100 Subject: [PATCH 20/87] Fix set_client for ReferenceField to support basestring values (transplanted from 5bbbe0bfad08bce235bc96f871b5341a956bbf26) --- tryton/gui/window/view_form/model/field.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py index af1fe4c944..65b5d32c29 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -617,6 +617,9 @@ class ReferenceField(CharField): if not value: record.value[self.name] = False return + if isinstance(value, basestring): + model, ref_id = value.split(',') + value = model, (ref_id, record.value.get(self.name + '.rec_name')) ref_model, (ref_id, ref_str) = value if ref_model: ref_id = int(ref_id) From 13b4f205e9a813523c6e3b79f1d30efdf05922cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 2 Mar 2011 11:33:09 +0100 Subject: [PATCH 21/87] Add missing return value test of sig_logout in sig_login for issue1882 (transplanted from 8b76ac28c7fb5cca569d82beb45cd987f2f4e2c1) --- tryton/gui/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 5f7537d9d1..4dc76a7c26 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -1131,7 +1131,8 @@ class Main(object): return ([], []) def sig_login(self, widget=None, dbname=False, res=None): - self.sig_logout(widget, disconnect=False) + if not self.sig_logout(widget, disconnect=False): + return if not res: try: dblogin = DBLogin(self.window) From 88cf50692f6b10aeaa87363ce82f1c4a5b46a742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 23 Mar 2011 14:56:54 +0100 Subject: [PATCH 22/87] gdk.pixbuf_new_from_file requires an unicode on windows (transplanted from 349b635edbec9f934cdc44842127c024ad054290) --- tryton/common/common.py | 3 ++- tryton/config.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index 035a716d57..d2ea2b4fc3 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -242,7 +242,8 @@ def file_selection(title, filename='', parent=None, def update_preview_cb(win, img): filename = win.get_preview_filename() try: - pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128) + pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename.encode('utf-8'), + 128, 128) img.set_from_pixbuf(pixbuf) have_preview = True except Exception: diff --git a/tryton/config.py b/tryton/config.py index 06c054a3be..c241e5825d 100644 --- a/tryton/config.py +++ b/tryton/config.py @@ -182,7 +182,7 @@ if not os.path.isdir(PIXMAPS_DIR): PIXMAPS_DIR = os.path.join(PREFIX, 'share', 'pixmaps', 'tryton') TRYTON_ICON = gtk.gdk.pixbuf_new_from_file( - os.path.join(PIXMAPS_DIR, 'tryton-icon.png')) + os.path.join(PIXMAPS_DIR, 'tryton-icon.png').encode('utf-8')) def _data_dir(): data_dir = os.path.join(CURRENT_DIR, 'share', 'tryton') From f3d49ca4b0177d2ccceb3eb24bc9a88eb156cf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 27 Mar 2011 23:24:58 +0200 Subject: [PATCH 23/87] Add missing copyright owner (transplanted from cc5d9200889cfc3a5658743f193ca04f57f5a229) --- COPYRIGHT | 1 + 1 file changed, 1 insertion(+) diff --git a/COPYRIGHT b/COPYRIGHT index f98ae5c521..a5466e753e 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -3,6 +3,7 @@ Copyright (C) 2007-2011 Bertrand Chenal. Copyright (C) 2008-2011 B2CK SPRL. Copyright (C) 2008-2011 Udo Spallek. Copyright (C) 2008-2011 virtual things - Preisler & Spallek GbR. +Copyright (C) 2007-2009 Lorenzo Gil Sanchez. Copyright (C) 2004-2008 Tiny SPRL. This program is free software: you can redistribute it and/or modify From 9e1252c1ef8de581990887de46756a037c64d572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 4 Apr 2011 15:21:48 +0200 Subject: [PATCH 24/87] Fix set_value on empty column for issue1925 (transplanted from 582fa55c13f17a3a7cb14e7415ccb29bf8e66b6a) --- 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 b7f13cf3e7..c33ef26d6f 100644 --- a/tryton/gui/window/view_form/view/list_gtk/editabletree.py +++ b/tryton/gui/window/view_form/view/list_gtk/editabletree.py @@ -113,7 +113,7 @@ class EditableTreeView(gtk.TreeView): def set_value(self): path, column = self.get_cursor() model = self.get_model() - if not path or not column: + if not path or not column or not column.name: return True record = model.get_value(model.get_iter(path), 0) field = record[column.name] From 5b2ee74709a9229f0b81989c300b9f6df2b0380c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 16 Apr 2011 19:38:29 +0200 Subject: [PATCH 25/87] Fix sig_plugin_execute when there is no tabs for issue1956 (transplanted from 5373514b47f645ff6941d66f181d3bcda0e75128) --- tryton/gui/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tryton/gui/main.py b/tryton/gui/main.py index 4dc76a7c26..f329cc0612 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -1293,6 +1293,8 @@ class Main(object): def sig_plugin_execute(self, widget): page = self.notebook.get_current_page() + if page == -1: + return datas = { 'model': self.pages[page].model, 'ids': self.pages[page].ids_get(), From eec56a295f6a00379072d491ae29712842034041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Apr 2011 10:58:42 +0200 Subject: [PATCH 26/87] Ensure record is selected for button action in list view for issue1974 (transplanted from d92b0dcc34e9d8d5664ed9bd974bfd9a3b5c6bf1) --- tryton/gui/window/view_form/view/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index a831e50350..9905f5a9a7 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -265,7 +265,7 @@ class ViewList(ParserView): act = action.copy() obj_ids = self.screen.sel_ids_get() obj_id = self.screen.id_get() - if not obj_ids and not obj_id: + if not obj_ids or not obj_id: message(_('No record selected!'), self.window) return False email = {} From 589a5682bcfb332b79fc92d3515ea32b11124ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 21 Apr 2011 17:51:51 +0200 Subject: [PATCH 27/87] Fix tuple typo for states (transplanted from ef4998b6dca5d23a95cc6f7465bc4c37052c983b) --- tryton/gui/window/view_form/view/list_gtk/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a782175f1f..66434faee8 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -267,7 +267,7 @@ class Char(object): else: align = 0 - states = ('invisible') + states = ('invisible',) if hasattr(self.treeview, 'editable') \ and self.treeview.editable: states = ('readonly', 'required', 'invisible') From 0154377afa2f60fb739655cf6738626f1f1b4271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 16 May 2011 12:58:06 +0200 Subject: [PATCH 28/87] Fix activate event of many2one when search is required for issue1993 (transplanted from cc6afc5c180f04f7ccceaafde3f43c59700a794d) --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 d5e66a36b9..5b38326a64 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -36,7 +36,7 @@ class Many2One(WidgetInterface): self.wid_text.connect('populate-popup', self._populate_popup) self.wid_text.connect_after('changed', self.sig_changed) self.changed = True - self.wid_text.connect_after('activate', self.sig_activate) + self.wid_text.connect('activate', self.sig_activate) self.wid_text.connect_after('focus-out-event', self.sig_activate) self.focus_out = True @@ -127,6 +127,8 @@ class Many2One(WidgetInterface): self.focus_out = False if not value: + if not key_press and not event: + widget.emit_stop_by_name('activate') if not self._readonly and (self.wid_text.get_text() or \ (self.field.get_state_attrs( self.record)['required']) and key_press): From 21d0362b170fccaca681cb27eb213329efd99578 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 29 May 2011 14:18:54 +0200 Subject: [PATCH 29/87] Prepare release 1.8.2 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 9389b626cf..45cc400b2b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.2 - 2011-05-29 +* Bug fixes (see mercurial logs for details) + Version 1.8.1 - 2011-02-13 * Bug fixes (see mercurial logs for details) From f4f7eaaf67ff579378c65dd047613047e5094f73 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 29 May 2011 14:18:54 +0200 Subject: [PATCH 30/87] Added tag 1.8.2 for changeset 2b18a98b5283 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 279c7f3eb3..7cb53fb37a 100644 --- a/.hgtags +++ b/.hgtags @@ -4,3 +4,4 @@ de84c1443d4bad908eabb99c381578b988c2117f 1.4.0 3976912b23dfc5db2525d4c2e55d17f099d9492d 1.6.0 8aa050da53cbdfabe1353a37da91c011b7fff549 1.8.0 ea11660a036ce298897045a00f3ed605b41e318a 1.8.1 +2b18a98b5283521c81f8c9c0d26c39c13f88ed69 1.8.2 From 5a4a3e98a4fe0e0980c2fd1e15ad3566192557d0 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 29 May 2011 14:19:23 +0200 Subject: [PATCH 31/87] 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 a49fe66ac0..f4cbb0d935 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.2" +VERSION = "1.8.3" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From da0c4f2fb3fc1532d88e75e17964971dcf373548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 30 May 2011 17:33:23 +0200 Subject: [PATCH 32/87] Fix float_time_to_text with Python 2.7 for issue2032 (transplanted from ee26ae500b83f2001371d0e05b83f1049c09ed5d) --- tryton/common/common.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index d2ea2b4fc3..35627e6305 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -1151,17 +1151,13 @@ def float_time_to_text(val, conv=None): val = val - hours mins = int((val% 1 + 0.01) / conv['m']) if years: - value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['Y'], - years, True) + value += ' ' + locale.format('%d', years, True) + FLOAT_TIME_SEPS['Y'] if months: - value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['M'], - months, True) + value += ' ' + locale.format('%d', months, True) + FLOAT_TIME_SEPS['M'] if weeks: - value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['w'], - weeks, True) + value += ' ' + locale.format('%d', weeks, True) + FLOAT_TIME_SEPS['w'] if days: - value += ' ' + locale.format('%d' + FLOAT_TIME_SEPS['d'], - days, True) + value += ' ' + locale.format('%d', days, True) + FLOAT_TIME_SEPS['d'] if hours or mins: value += ' %02d:%02d' % (hours, mins) value = value.strip() From eb07340db3242f142eea237a85183ade4b6b2545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 24 Jun 2011 16:07:08 +0200 Subject: [PATCH 33/87] Add missing import of WinSearch in WinForm (transplanted from 4cbbde98a309d4ad31acb77b007254565b6adc07) --- tryton/gui/window/win_form.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py index e2150774ee..38e178763b 100644 --- a/tryton/gui/window/win_form.py +++ b/tryton/gui/window/win_form.py @@ -236,6 +236,7 @@ class WinForm(object): self.wid_text.grab_focus() def _sig_add(self, *args): + from tryton.gui.window.win_search import WinSearch domain = [] context = rpc.CONTEXT.copy() From 06910358c46964d0b3e21e3d3e74e645113d665a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 28 Jun 2011 23:34:32 +0200 Subject: [PATCH 34/87] Ensure that parent_name is always a string (transplanted from f399f9288753fc0916ecb4f85d41d6a3b01ba422) --- tryton/gui/window/view_form/model/group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/model/group.py b/tryton/gui/window/view_form/model/group.py index 1c199d7bf8..e4e4235708 100644 --- a/tryton/gui/window/view_form/model/group.py +++ b/tryton/gui/window/view_form/model/group.py @@ -16,7 +16,7 @@ class Group(SignalEvent, list): self.lock_signal = False self.__window = window self.parent = parent - self.parent_name = parent_name + self.parent_name = parent_name or '' self.parent_datetime_field = parent_datetime_field self._context = context or {} self.model_name = model_name From 3ad1b043fb400703fc27a7ca1ec5be713f78048b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 30 Jun 2011 13:17:29 +0200 Subject: [PATCH 35/87] Remove old parent parameter in progressbar (transplanted from 206f28cc49a147db59a32e91e338e44f82906ad4) --- tryton/gui/window/view_form/view/form_gtk/progressbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/progressbar.py b/tryton/gui/window/view_form/view/form_gtk/progressbar.py index 1734f5f659..79e2b00f03 100644 --- a/tryton/gui/window/view_form/view/form_gtk/progressbar.py +++ b/tryton/gui/window/view_form/view/form_gtk/progressbar.py @@ -16,7 +16,7 @@ class ProgressBar(WidgetInterface): def __init__(self, field_name, model_name, window, attrs=None): super(ProgressBar, self).__init__(field_name, model_name, window, - parent, attrs=attrs) + attrs=attrs) self.widget = gtk.ProgressBar() orientation = self.orientations.get(attrs.get('orientation', 'left_to_right'), gtk.PROGRESS_LEFT_TO_RIGHT) From fb38a4a9bea8898d869b2d5e57b06ddc8d40cb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 15 Jul 2011 18:15:12 +0200 Subject: [PATCH 36/87] Close every PixbufLoader (transplanted from 23939a938789dcc9914e898298647bae0531bb2a) --- tryton/gui/window/view_form/view/form_gtk/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/image.py b/tryton/gui/window/view_form/view/form_gtk/image.py index f1356c519d..9c8086e6d5 100644 --- a/tryton/gui/window/view_form/view/form_gtk/image.py +++ b/tryton/gui/window/view_form/view/form_gtk/image.py @@ -161,14 +161,14 @@ class Image(WidgetInterface): except Exception: continue pixbuf = loader.get_pixbuf() + loader.close() if pixbuf: break if not pixbuf: loader = gtk.gdk.PixbufLoader('png') loader.write(NOIMAGE, len(NOIMAGE)) pixbuf = loader.get_pixbuf() - - loader.close() + loader.close() img_height = pixbuf.get_height() if img_height > self.height: From 2ff4ea3637f56d22e4531c034c0745a1afa3bb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 15 Jul 2011 18:16:55 +0200 Subject: [PATCH 37/87] Remove spreading active_id(s) in board action review49009 (transplanted from ca470354201defe937abd164b5fc962a29371301) --- tryton/gui/window/view_board/action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_board/action.py b/tryton/gui/window/view_board/action.py index 3ec8cee780..629aaf9980 100644 --- a/tryton/gui/window/view_board/action.py +++ b/tryton/gui/window/view_board/action.py @@ -43,7 +43,7 @@ class Action(object): self.action['view_mode'] = attrs['view_mode'] self.action.setdefault('pyson_domain', '[]') - self.context = {'active_id': False, 'active_ids': []} + self.context = {} self.context.update(PYSONDecoder(self.context).decode( self.action.get('pyson_context', '{}'))) From a7e67e542f783d77cd90b2e1fd4677e6476acf13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Jul 2011 21:54:36 +0200 Subject: [PATCH 38/87] Test if any column has width before saving it otherwise list is hidden and there is no width review48004 (transplanted from 223e96d3b08f76519fe935089d346242e9e9e522) --- tryton/gui/window/view_form/view/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 9905f5a9a7..5b7933ff84 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -513,7 +513,7 @@ class ViewList(ParserView): if last_col and last_col.name in fields: del fields[last_col.name] - if fields: + if fields and any(fields.itervalues()): try: rpc.execute('model', 'ir.ui.view_tree_width', 'set_width', self.screen.model_name, fields, rpc.CONTEXT) From e868abc4ab63880c5d18ad33d7a552ab21a82128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 22 Jul 2011 15:42:56 +0200 Subject: [PATCH 39/87] Fix typo filepath -> filename when saving graph (transplanted from 3fd018519880c72ecbab5747587c11939adfbca6) --- tryton/gui/window/view_form/view/graph_gtk/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/graph_gtk/parser.py b/tryton/gui/window/view_form/view/graph_gtk/parser.py index 27a5950ab7..03efdcc3f7 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/parser.py +++ b/tryton/gui/window/view_form/view/graph_gtk/parser.py @@ -77,7 +77,7 @@ def save(widget, graph, window): filename = filename.decode('utf-8') try: CONFIG['client.default_path'] = \ - os.path.dirname(filepath) + os.path.dirname(filename) CONFIG.save() except Exception: pass From 30ad35ae2c246e0e7aa06d2db6851ad711aeda9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 22 Jul 2011 15:54:49 +0200 Subject: [PATCH 40/87] Use str for cairo.Surface.write_to_png Old version doesn't support unicode (transplanted from 45368348fad448334fe324e5fb0ec729c63d0ebe) --- tryton/gui/window/view_form/view/graph_gtk/graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/graph_gtk/graph.py b/tryton/gui/window/view_form/view/graph_gtk/graph.py index ec1fbb4d60..0dcd6cf155 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/graph.py +++ b/tryton/gui/window/view_form/view/graph_gtk/graph.py @@ -122,7 +122,7 @@ class Graph(gtk.DrawingArea): self.drawGraph(cx, width, height) self.drawAxis(cx, width, height) self.drawLegend(cx, width, height) - surface.write_to_png(filename) + surface.write_to_png(filename.encode('utf-8')) self.queue_draw() From e7c5af47ab42ed1d16ba08286b74d2d5f54cef4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Aug 2011 11:33:37 +0200 Subject: [PATCH 41/87] Fix load of predefined export without lines issue2124 (transplanted from 4b3a3808b0d11ad2de119bdefaec9e34e93bc2a8) --- tryton/gui/window/win_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/win_export.py b/tryton/gui/window/win_export.py index fee597f4e3..4d1afe18a8 100644 --- a/tryton/gui/window/win_export.py +++ b/tryton/gui/window/win_export.py @@ -304,7 +304,7 @@ class WinExport(object): for export in exports: self.predef_model.append(( export['id'], - [x['name'] for x in id2lines[export['id']]], + [x['name'] for x in id2lines.get(export['id'], [])], export['name'])) self.pref_export.set_model(self.predef_model) From b1c7dfbd25800ac5dd74f44631b4d4ec532b1ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Mon, 22 Aug 2011 19:21:55 +0200 Subject: [PATCH 42/87] Ensure environment variable are str issue87001 (transplanted from 75fb228ad8ad7cd412d27af5ae511dae2b9b9518) --- tryton/translate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tryton/translate.py b/tryton/translate.py index 82726553db..b5a0ad94a5 100644 --- a/tryton/translate.py +++ b/tryton/translate.py @@ -172,11 +172,13 @@ def setlang(lang=None, locale_dict=None): elif os.name == 'mac' or \ (hasattr(os, 'uname') and os.uname()[0] == 'Darwin'): encoding = 'UTF-8' + # ensure environment variable are str + lang, lang2, encoding = str(lang), str(lang2), str(encoding) os.environ['LANGUAGE'] = lang os.environ['LC_ALL'] = lang2 + '.' + encoding os.environ['LC_MESSAGES'] = lang2 + '.' + encoding os.environ['LANG'] = lang + '.' + encoding - locale.setlocale(locale.LC_ALL, str(lang2 + '.' + encoding)) + locale.setlocale(locale.LC_ALL, lang2 + '.' + encoding) except Exception: logging.getLogger('translate').info( _('Unable to set locale %s') % lang2 + '.' + encoding) From 4c3016777bbcadcdbb056a8f401ddeb0235c5b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 12 Sep 2011 12:39:52 +0200 Subject: [PATCH 43/87] Catch all GError exception when using PixbufLoader issue2144 (transplanted from 216ea2f5406ab8fc60d596c7fddfd7db90ad0964) --- tryton/gui/window/view_form/view/form_gtk/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/image.py b/tryton/gui/window/view_form/view/form_gtk/image.py index 9c8086e6d5..c5d38b5f01 100644 --- a/tryton/gui/window/view_form/view/form_gtk/image.py +++ b/tryton/gui/window/view_form/view/form_gtk/image.py @@ -158,10 +158,10 @@ class Image(WidgetInterface): try: loader = gtk.gdk.PixbufLoader(ftype) loader.write(data, len(data)) + pixbuf = loader.get_pixbuf() + loader.close() except Exception: continue - pixbuf = loader.get_pixbuf() - loader.close() if pixbuf: break if not pixbuf: From 2f7b7e141d78ff3bdc3d107ed727138261cb8c4c Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sat, 1 Oct 2011 14:16:48 +0200 Subject: [PATCH 44/87] Prepare release 1.8.3 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 45cc400b2b..b2897ebcad 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.3 - 2011-10-01 +* Bug fixes (see mercurial logs for details) + Version 1.8.2 - 2011-05-29 * Bug fixes (see mercurial logs for details) From 077b9dee70845a9d643cbe1582b64383758c311b Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sat, 1 Oct 2011 14:16:49 +0200 Subject: [PATCH 45/87] Added tag 1.8.3 for changeset eed0c27dabc2 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 7cb53fb37a..c48bc5a8aa 100644 --- a/.hgtags +++ b/.hgtags @@ -5,3 +5,4 @@ de84c1443d4bad908eabb99c381578b988c2117f 1.4.0 8aa050da53cbdfabe1353a37da91c011b7fff549 1.8.0 ea11660a036ce298897045a00f3ed605b41e318a 1.8.1 2b18a98b5283521c81f8c9c0d26c39c13f88ed69 1.8.2 +eed0c27dabc2051a407f8bbcfb9b49f804504e70 1.8.3 From dc3dcec551e48ba56c086f47433cc5398bb2175a Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sat, 1 Oct 2011 14:17:20 +0200 Subject: [PATCH 46/87] 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 f4cbb0d935..d1f1b9a1f2 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.3" +VERSION = "1.8.4" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From b42fed9ada7f75661f411b0c32addcc5e03112bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 19 Oct 2011 13:14:06 +0200 Subject: [PATCH 47/87] Set default view_ids to None instead of False issue2213 review158002 (transplanted from c5efff6a74778ebe78169375c7eec290c844404e) --- tryton/gui/window/view_board/action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_board/action.py b/tryton/gui/window/view_board/action.py index 629aaf9980..084f4930ae 100644 --- a/tryton/gui/window/view_board/action.py +++ b/tryton/gui/window/view_board/action.py @@ -31,7 +31,7 @@ class Action(object): common.process_exception(exception, self._window) raise - view_ids = False + view_ids = None self.action['view_mode'] = None if self.action.get('views', []): view_ids = [x[0] for x in self.action['views']] From 9c3e3ff8e06e93fc1800a20edcf20c40ccd081a4 Mon Sep 17 00:00:00 2001 From: Max Holtzberg Date: Wed, 19 Oct 2011 13:06:49 +0200 Subject: [PATCH 48/87] Fix handling of dates < 1900 issue2040 review113002 (transplanted from 38a62d96a6ef13b53e285db64c2ff0fcad198a10) --- tryton/common/date_widget.py | 9 +------ tryton/common/datetime_strftime.py | 2 +- .../view_form/view/form_gtk/calendar.py | 27 +++---------------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/tryton/common/date_widget.py b/tryton/common/date_widget.py index f3cfa761c6..5f7e4396f9 100644 --- a/tryton/common/date_widget.py +++ b/tryton/common/date_widget.py @@ -132,14 +132,7 @@ class DateEntry(gtk.Entry): def date_set(self, dt): if dt: - format = self.format - if dt.year < 10: - format = format.replace('%Y', '000%Y') - elif dt.year < 100: - format = format.replace('%Y', '00%Y') - elif dt.year < 1000: - format = format.replace('%Y', '0%Y') - self.set_text(datetime_strftime(dt, format)) + self.set_text(datetime_strftime(dt, self.format)) else: if self.is_focus(): self.set_text(self.initial_value) diff --git a/tryton/common/datetime_strftime.py b/tryton/common/datetime_strftime.py index 65f6fa50f4..d125d8d204 100644 --- a/tryton/common/datetime_strftime.py +++ b/tryton/common/datetime_strftime.py @@ -44,7 +44,7 @@ def datetime_strftime(dt, fmt): sites.append(site) s = s1 - syear = "%4d" % (dt.year,) + syear = "%04d" % (dt.year,) for site in sites: s = s[:site] + syear + s[site+4:] return s 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 80b080759b..2257e4c540 100644 --- a/tryton/gui/window/view_form/view/form_gtk/calendar.py +++ b/tryton/gui/window/view_form/view/form_gtk/calendar.py @@ -93,14 +93,7 @@ class Calendar(WidgetInterface): if len(value)>10: value = value[:10] date = datetime.date(*time.strptime(value, DT_FORMAT)[:3]) - format = self.format - if date.year < 10: - format = format.replace('%Y', '000%Y') - elif date.year < 100: - format = format.replace('%Y', '00%Y') - elif date.year < 1000: - format = format.replace('%Y', '0%Y') - value = datetime_strftime(date, format) + value = datetime_strftime(date, self.format) if len(value) > self.entry.get_width_chars(): self.entry.set_width_chars(len(value)) self.entry.set_text(value) @@ -139,14 +132,7 @@ class Calendar(WidgetInterface): if response == gtk.RESPONSE_OK: year, month, day = cal.get_date() date = datetime.date(year, month + 1, day) - format = self.format - if date.year < 10: - format = format.replace('%Y', '000%Y') - elif date.year < 100: - format = format.replace('%Y', '00%Y') - elif date.year < 1000: - format = format.replace('%Y', '0%Y') - self.entry.set_text(datetime_strftime(date, format)) + self.entry.set_text(datetime_strftime(date, self.format)) self._focus_out() self.window.present() win.destroy() @@ -248,14 +234,7 @@ class DateTime(WidgetInterface): date = ldt except Exception: pass - format = self.format - if date.year < 10: - format = format.replace('%Y', '000%Y') - elif date.year < 100: - format = format.replace('%Y', '00%Y') - elif date.year < 1000: - format = format.replace('%Y', '0%Y') - value = datetime_strftime(date, format) + value = datetime_strftime(date, self.format) if len(value) > self.entry.get_width_chars(): self.entry.set_width_chars(len(value)) self.entry.set_text(value) From 8942631d5df43a9319f279179fa71e397e86ee60 Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Wed, 2 Nov 2011 11:12:56 +0100 Subject: [PATCH 49/87] Do not use PYSONDecoder() to eval states of button in list view issue2244 (transplanted from a5609b61695b8a7bdb6f7b21a96054b04a5d047a) --- tryton/gui/window/view_form/view/list_gtk/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 66434faee8..fc97a577db 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -843,8 +843,8 @@ class Button(object): store = self.treeview.get_model() record = store.get_value(store.get_iter(path), 0) - state_changes = PYSONDecoder().decode(record.expr_eval( - self.attrs.get('states', {}), check_load=False)) + state_changes = record.expr_eval( + self.attrs.get('states', {}), check_load=False) if state_changes.get('invisible') \ or state_changes.get('readonly'): return True From e309ecf241ba8e316de2e5939ae5c09bf8376337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 14 Nov 2011 18:01:15 +0100 Subject: [PATCH 50/87] Add allowed ops in safe_eval for Python 2.7 (transplanted from 886cd06d78838bfca94095d8d6fc3e5809dd2f1f) --- tryton/common/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tryton/common/common.py b/tryton/common/common.py index 35627e6305..1e83942f5c 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -1192,6 +1192,7 @@ _ALLOWED_CODES = set(dis.opmap[x] for x in [ 'STORE_MAP', 'LOAD_NAME', 'CALL_FUNCTION', 'COMPARE_OP', 'LOAD_ATTR', 'STORE_NAME', 'GET_ITER', 'FOR_ITER', 'LIST_APPEND', 'JUMP_ABSOLUTE', 'DELETE_NAME', 'JUMP_IF_TRUE', 'JUMP_IF_FALSE', 'JUMP_IF_FALSE_OR_POP', + 'JUMP_IF_TRUE_OR_POP', 'POP_JUMP_IF_FALSE', 'POP_JUMP_IF_TRUE', 'BINARY_SUBSCR', ] if x in dis.opmap) From cfd015af1c38fa784b2e78d172fc9e07d975a6ad Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 26 Dec 2011 10:37:02 +0100 Subject: [PATCH 51/87] Prepare release 1.8.4 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index b2897ebcad..96103f9223 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.4 - 2011-12-26 +* Bug fixes (see mercurial logs for details) + Version 1.8.3 - 2011-10-01 * Bug fixes (see mercurial logs for details) From 8e6b707c41ab6a9fc0fa2b1257f791890d8cb7de Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 26 Dec 2011 10:37:03 +0100 Subject: [PATCH 52/87] Added tag 1.8.4 for changeset 7f30158dab96 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c48bc5a8aa..a2fca3355c 100644 --- a/.hgtags +++ b/.hgtags @@ -6,3 +6,4 @@ de84c1443d4bad908eabb99c381578b988c2117f 1.4.0 ea11660a036ce298897045a00f3ed605b41e318a 1.8.1 2b18a98b5283521c81f8c9c0d26c39c13f88ed69 1.8.2 eed0c27dabc2051a407f8bbcfb9b49f804504e70 1.8.3 +7f30158dab9688a8df5783e6253a7321f298dac2 1.8.4 From db2488ec2936e44942daa84a145dcacd9d5a987e Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 26 Dec 2011 10:37:33 +0100 Subject: [PATCH 53/87] 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 d1f1b9a1f2..783518309a 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.4" +VERSION = "1.8.5" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From 493b1d6b53af89b0a506f2d6462b6308d6dde7f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 2 Jan 2012 18:50:01 +0100 Subject: [PATCH 54/87] Remove entry added to combobox in win_import review210009 (transplanted from 40d5157e9d58f50a00464d280de36a4a0af4a876) --- tryton/gui/window/win_import.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tryton/gui/window/win_import.py b/tryton/gui/window/win_import.py index 4733a2dde1..e59e1100db 100644 --- a/tryton/gui/window/win_import.py +++ b/tryton/gui/window/win_import.py @@ -143,9 +143,6 @@ class WinImport(object): self.import_csv_enc = gtk.combo_box_new_text() self.import_csv_enc.append_text("UTF-8") self.import_csv_enc.append_text("Latin1") - cboxent_import_csv_enc = gtk.Entry() - cboxent_import_csv_enc.unset_flags(gtk.CAN_FOCUS) - self.import_csv_enc.add(cboxent_import_csv_enc) table.attach(self.import_csv_enc, 1, 2, 1, 2) label_import_csv_skip = gtk.Label(_("Lines to Skip:")) From 1cb52317a0d5773bffa56e9411b1008b6303acda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 17 Jan 2012 13:56:50 +0100 Subject: [PATCH 55/87] Fix float_time widget to round value according to digits review222007 (transplanted from 2aa50bbdde4d89b314fd85b24ec4dcf7f4f0a56d) --- tryton/gui/window/view_form/view/form_gtk/float_time.py | 3 ++- tryton/gui/window/view_form/view/list_gtk/parser.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/float_time.py b/tryton/gui/window/view_form/view/form_gtk/float_time.py index 738b09eae6..ad78523752 100644 --- a/tryton/gui/window/view_form/view/form_gtk/float_time.py +++ b/tryton/gui/window/view_form/view/form_gtk/float_time.py @@ -37,8 +37,9 @@ class FloatTime(WidgetInterface): value = self.entry.get_text() if not value: return field.set_client(record, 0.0) + digits = record.expr_eval(field.attrs.get('digits', (16, 2))) return field.set_client(record, - common.text_to_float_time(value, self.conv)) + round(common.text_to_float_time(value, self.conv), digits[1])) def display(self, record, field): super(FloatTime, self).display(record, field) 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 fc97a577db..a89c06cac1 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -474,7 +474,9 @@ class FloatTime(Char): return common.float_time_to_text(val, self.conv) def value_from_text(self, record, text): - return common.text_to_float_time(text, self.conv) + field = record[self.field_name] + digits = record.expr_eval(field.attrs.get('digits', (16, 2))) + return round(common.text_to_float_time(text, self.conv), digits[1]) class M2O(Char): From 3fc970da9d87eeb71c6257e46ac8c94917dd5dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 17 Jan 2012 15:38:02 +0100 Subject: [PATCH 56/87] Destroy also values of record Otherwise the groups of xxx2many records stay in the memory due to reference cycle between Group and Record. review222006 (transplanted from 34842c74fbc585bd9b8e9a3be64fa2640967ece7) --- tryton/gui/window/view_form/model/record.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index 71525d09f7..a127a4857a 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -464,5 +464,8 @@ class Record(SignalEvent): self.window = None self.parent = None self.group = None + for v in self.value.itervalues(): + if hasattr(v, 'destroy'): + v.destroy() self.value = None self.next = None From 24008020d6aaee7dde023d2f867103bbeff10400 Mon Sep 17 00:00:00 2001 From: Oscar Alvarez Date: Mon, 30 Jan 2012 22:06:29 -0500 Subject: [PATCH 57/87] Fix the export wizard for load all predef fields saved It modified using method iter_children issue2383 review219002 (transplanted from 232508536908ca64d4f8380896e884d6d1093acf) --- tryton/gui/window/win_export.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/win_export.py b/tryton/gui/window/win_export.py index 4d1afe18a8..271d1d6dc3 100644 --- a/tryton/gui/window/win_export.py +++ b/tryton/gui/window/win_export.py @@ -369,9 +369,12 @@ class WinExport(object): (prefix + parent): self.on_row_expanded(self.view1, iter, self.model1.get_path(iter)) + iter = self.model1.iter_children(iter) + prefix = parent + '/' break - iter = self.model1.iter_next(iter) - prefix = parent + '/' + else: + iter = self.model1.iter_next(iter) + if field not in self.fields_data: continue self.model2.append((self.fields_data[field]['string'], field)) From fa4430a93051a3e55780c333d887a4873cf2c493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 21 Feb 2012 16:19:03 +0100 Subject: [PATCH 58/87] Remove trailing space (transplanted from af3e207f00156b9388eb124ce13cb3380e81b670) --- tryton/gui/window/win_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/win_export.py b/tryton/gui/window/win_export.py index 271d1d6dc3..e1ea9aa4ef 100644 --- a/tryton/gui/window/win_export.py +++ b/tryton/gui/window/win_export.py @@ -374,7 +374,7 @@ class WinExport(object): break else: iter = self.model1.iter_next(iter) - + if field not in self.fields_data: continue self.model2.append((self.fields_data[field]['string'], field)) From a2d1714f1196cfe1dd99acb94003e4919a76e069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 1 Mar 2012 10:18:31 +0100 Subject: [PATCH 59/87] Return empty list when calling O2M.get if empty Test on required state except to have a value evaluated to False in case of empty O2M. issue2382 review258002 (transplanted from 9364d03b9467364498b3f0e97b0fd2e0e85dfa10) --- tryton/gui/window/view_form/model/field.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tryton/gui/window/view_form/model/field.py b/tryton/gui/window/view_form/model/field.py index 65b5d32c29..f25e07a454 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -377,6 +377,8 @@ class O2MField(CharField): else: result.append(('create', record2.get(check_load=check_load, get_readonly=readonly))) + if not result[0][1]: + del result[0] if record.value[self.name].record_removed: result.append(('unlink', [x.id for x in \ record.value[self.name].record_removed])) From c678bfdb26e75fc80e5a44a61f475cfcfcd84523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Mar 2012 10:15:53 +0100 Subject: [PATCH 60/87] Use relativedelta to make all the datetime computation issue2469 (transplanted from 9516267d90bd89a0c49c225d639380cbc991e928) --- tryton/pyson.py | 59 ++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/tryton/pyson.py b/tryton/pyson.py index b3d375bb30..eaead71f2c 100644 --- a/tryton/pyson.py +++ b/tryton/pyson.py @@ -6,6 +6,7 @@ if sys.version_info < (2, 6): else: import json import datetime +from dateutil.relativedelta import relativedelta class PYSON(object): @@ -394,23 +395,14 @@ class Date(PYSON): @staticmethod def eval(dct, context): - date = datetime.date.today() - replace = {} - for i, j in (('y', 'year'), ('M', 'month'), ('d', 'day')): - if dct[i] is not None: - replace[j] = dct[i] - date = date.replace(**replace) - if dct['dy']: - year = date.year + dct['dy'] - date = date.replace(year=year) - if dct['dM']: - month = date.month + dct['dM'] - year = date.year + month / 12 - month = month % 12 - date = date.replace(year=year, month=month) - if dct['dd']: - date += datetime.timedelta(days=dct['dd']) - return date + return datetime.date.today() + relativedelta( + year=dct['y'], + month=dct['M'], + day=dct['d'], + years=dct['dy'], + months=dct['dM'], + days=dct['dd'], + ) class DateTime(Date): @@ -458,22 +450,23 @@ class DateTime(Date): @staticmethod def eval(dct, context): - date = Date.eval(dct, context) - datetime_ = datetime.datetime.combine(date, - datetime.datetime.now().time()) - replace = {} - for i, j in (('h', 'hour'), ('m', 'minute'), ('s', 'second'), - ('ms', 'microsecond')): - if dct[i] is not None: - replace[j] = dct[i] - datetime_ = datetime_.replace(**replace) - delta = {} - for i, j in (('dh', 'hours'), ('dm', 'minutes'), ('ds', 'seconds'), - ('dms', 'microseconds')): - if dct[i]: - delta[j] = dct[i] - datetime_ += datetime.timedelta(**delta) - return datetime_ + return datetime.datetime.now() + relativedelta( + year=dct['y'], + month=dct['M'], + day=dct['d'], + hour=dct['h'], + minute=dct['m'], + second=dct['s'], + microsecond=dct['ms'], + years=dct['dy'], + months=dct['dM'], + days=dct['dd'], + hours=dct['dh'], + minutes=dct['dm'], + seconds=dct['ds'], + microseconds=dct['dms'], + ) + CONTEXT = { 'Eval': Eval, From ae794b6f8734b6edbce328b8715b8f2857a75b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 7 Mar 2012 16:17:19 +0100 Subject: [PATCH 61/87] Use field.context_get instead of evaluating the context attribute (transplanted from 676c65f18b1142f3d97df308a0b1253a44775973) --- tryton/gui/window/view_form/view/form_gtk/one2many.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/one2many.py b/tryton/gui/window/view_form/view/form_gtk/one2many.py index 23c03f77fb..2372711e33 100644 --- a/tryton/gui/window/view_form/view/form_gtk/one2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/one2many.py @@ -220,7 +220,7 @@ class One2Many(WidgetInterface): self.screen.display() return ctx = {} - ctx.update(self.record.expr_eval(self.attrs.get('context', {}))) + ctx.update(self.field.context_get(self.record)) sequence = None if self.screen.current_view.view_type == 'tree': sequence = self.screen.current_view.widget_tree.sequence From 3a9394bc282ab653a41705c785e786ef33ec7b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 13 Apr 2012 14:24:08 +0200 Subject: [PATCH 62/87] PixbufLoader must be closed before getting pixbuf On windows, jpeg loader needs to be closed to return correct pixbuf. issue2482 (transplanted from 726bb7cfc5e424cdc919ce9cdc37b4fa5f553cf0) --- tryton/gui/window/view_form/view/form_gtk/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/image.py b/tryton/gui/window/view_form/view/form_gtk/image.py index c5d38b5f01..ccccfc2808 100644 --- a/tryton/gui/window/view_form/view/form_gtk/image.py +++ b/tryton/gui/window/view_form/view/form_gtk/image.py @@ -158,8 +158,8 @@ class Image(WidgetInterface): try: loader = gtk.gdk.PixbufLoader(ftype) loader.write(data, len(data)) - pixbuf = loader.get_pixbuf() loader.close() + pixbuf = loader.get_pixbuf() except Exception: continue if pixbuf: @@ -167,8 +167,8 @@ class Image(WidgetInterface): if not pixbuf: loader = gtk.gdk.PixbufLoader('png') loader.write(NOIMAGE, len(NOIMAGE)) - pixbuf = loader.get_pixbuf() loader.close() + pixbuf = loader.get_pixbuf() img_height = pixbuf.get_height() if img_height > self.height: From 70bfd62deb23fc2afe999acf62419c9629040354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 18 Apr 2012 20:00:06 +0200 Subject: [PATCH 63/87] Reset current_record before clearing group (transplanted from 6c8591e020f818a25b62925a3e4eccd4e49a057f) --- 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 ec908618b7..22aae746ca 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -700,8 +700,8 @@ class Screen(SignalEvent): return [x.id for x in self.group if x.id] def clear(self): - self.group.clear() self.current_record = None + self.group.clear() def on_change(self, fieldname, attr): self.current_record.on_change(fieldname, attr) From 0be5a4f75dd95deaba29206600b649844e3b3a9f Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 7 May 2012 11:06:20 +0200 Subject: [PATCH 64/87] Prepare release 1.8.5 --- CHANGELOG | 3 +++ COPYRIGHT | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 96103f9223..93eac02312 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.5 - 2012-05-07 +* Bug fixes (see mercurial logs for details) + Version 1.8.4 - 2011-12-26 * Bug fixes (see mercurial logs for details) diff --git a/COPYRIGHT b/COPYRIGHT index a5466e753e..42e7347f4f 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2007-2011 Cédric Krier. +Copyright (C) 2007-2012 Cédric Krier. Copyright (C) 2007-2011 Bertrand Chenal. -Copyright (C) 2008-2011 B2CK SPRL. +Copyright (C) 2008-2012 B2CK SPRL. Copyright (C) 2008-2011 Udo Spallek. Copyright (C) 2008-2011 virtual things - Preisler & Spallek GbR. Copyright (C) 2007-2009 Lorenzo Gil Sanchez. From d9e9394dfc1bd93babc2eb3d40579381949748cb Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 7 May 2012 11:06:21 +0200 Subject: [PATCH 65/87] Added tag 1.8.5 for changeset 6bf0a9325f01 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index a2fca3355c..b8717b99ff 100644 --- a/.hgtags +++ b/.hgtags @@ -7,3 +7,4 @@ ea11660a036ce298897045a00f3ed605b41e318a 1.8.1 2b18a98b5283521c81f8c9c0d26c39c13f88ed69 1.8.2 eed0c27dabc2051a407f8bbcfb9b49f804504e70 1.8.3 7f30158dab9688a8df5783e6253a7321f298dac2 1.8.4 +6bf0a9325f010d65bb27e8c6a01f7610b5031fe3 1.8.5 From f1bd36e744d9260e2bf1d96afb19d915dc05dc20 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Mon, 7 May 2012 11:06:50 +0200 Subject: [PATCH 66/87] 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 783518309a..fa9415f958 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.5" +VERSION = "1.8.6" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From 8858bd3d9545df7f25c85134db2c14c9ef40ff98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 22 Jun 2012 17:53:35 +0200 Subject: [PATCH 67/87] Fix name of fields loaded from predefined export issue2648 review404001 (transplanted from 481bf839727a0a1afff30fb963e46afa368b4306) --- tryton/gui/window/win_export.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/win_export.py b/tryton/gui/window/win_export.py index e1ea9aa4ef..142ca62e56 100644 --- a/tryton/gui/window/win_export.py +++ b/tryton/gui/window/win_export.py @@ -246,7 +246,8 @@ class WinExport(object): child = self.model1.iter_children(iter) if self.model1.get_value(child, 0) is None: prefix_field = self.model1.get_value(iter, 1) - name, model = self.fields[prefix_field] + _, model = self.fields[prefix_field] + name = self.fields_data[prefix_field]['string'] self.model_populate(self._get_fields(model), iter, prefix_field + '/', name + '/') self.model1.remove(child) From c54ba15cd5c16880bdedace61c5d819dbb5085c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 28 Jun 2012 15:11:17 +0200 Subject: [PATCH 68/87] set_value of M2O must simulate a focus-out in case it did not yet occur issue2624 review408001 (transplanted from a07d90df4d9e6b98778260ec684b6f1317a4cb8b) --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 5b38326a64..d43253cef6 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -117,7 +117,7 @@ class Many2One(WidgetInterface): def _color_widget(self): return self.wid_text - def sig_activate(self, widget, event=None, key_press=False): + def sig_activate(self, widget=None, event=None, key_press=False): if not self.focus_out: return if not self.field: @@ -127,7 +127,7 @@ class Many2One(WidgetInterface): self.focus_out = False if not value: - if not key_press and not event: + if not key_press and not event and widget: widget.emit_stop_by_name('activate') if not self._readonly and (self.wid_text.get_text() or \ (self.field.get_state_attrs( @@ -280,7 +280,8 @@ class Many2One(WidgetInterface): return False def set_value(self, record, field): - pass # No update of the model, the model is updated in real time ! + # Simulate a focus-out + self.sig_activate() def display(self, record, field): self.changed = False From 83c534ce3e51b6728ba48d40b429d1a611016adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 25 Jul 2012 20:31:56 +0200 Subject: [PATCH 69/87] Fix test on legend graph attribute review421001 (transplanted from 883480d210a7b3361afc69df26e766c62a4e76dc) --- tryton/gui/window/view_form/view/graph_gtk/graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/graph_gtk/graph.py b/tryton/gui/window/view_form/view/graph_gtk/graph.py index 0dcd6cf155..ae02977611 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/graph.py +++ b/tryton/gui/window/view_form/view/graph_gtk/graph.py @@ -268,7 +268,7 @@ class Graph(gtk.DrawingArea): cr.restore() def drawLegend(self, cr, width, height): - if not self.attrs.get('legend', True): + if not int(self.attrs.get('legend', 1)): return padding = 4 From dfd185b1422ff8d13993d87baecf243b7a50f088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 1 Sep 2012 19:02:38 +0200 Subject: [PATCH 70/87] Prepare release 1.8.6 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 93eac02312..352e4b9332 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.6 - 2012-09-01 +* Bug fixes (see mercurial logs for details) + Version 1.8.5 - 2012-05-07 * Bug fixes (see mercurial logs for details) From 6f6eb5fc435ef10bba6500ff65d777c5882ec74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 1 Sep 2012 19:02:39 +0200 Subject: [PATCH 71/87] Added tag 1.8.6 for changeset c4577149a154 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index b8717b99ff..c7e8bf2534 100644 --- a/.hgtags +++ b/.hgtags @@ -8,3 +8,4 @@ ea11660a036ce298897045a00f3ed605b41e318a 1.8.1 eed0c27dabc2051a407f8bbcfb9b49f804504e70 1.8.3 7f30158dab9688a8df5783e6253a7321f298dac2 1.8.4 6bf0a9325f010d65bb27e8c6a01f7610b5031fe3 1.8.5 +c4577149a154a60b6f61b7578013d6df69d57b2b 1.8.6 From 9a12231aa2404fdd5a5ab2ae7734edd4e3f4d744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 1 Sep 2012 19:03:21 +0200 Subject: [PATCH 72/87] 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 fa9415f958..d089dfa2be 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.6" +VERSION = "1.8.7" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From bb835884aecf5c40a72a6c08038ecd78a74bd368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 1 Oct 2012 16:07:19 +0200 Subject: [PATCH 73/87] Don't store interger as current record Use inline if/else instead of and issue2701 (transplanted from 33f9f70a701fb253463297e173345e8d08cc58f3) --- tryton/gui/window/view_form/screen/screen.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index 22aae746ca..04d30e927e 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -652,8 +652,7 @@ class Screen(SignalEvent): idx = len(self.group) - 1 self.current_record = self.group[idx] else: - self.current_record = len(self.group) \ - and self.group[0] + self.current_record = self.group[0] if len(self.group) else None self.current_view.set_cursor(reset_view=False) if self.current_record: self.current_record.validate_set() @@ -681,8 +680,7 @@ class Screen(SignalEvent): idx = 0 self.current_record = self.group[idx] else: - self.current_record = len(self.group) \ - and self.group[-1] + self.current_record = self.group[-1] if len(self.group) else None self.current_view.set_cursor(reset_view=False) if self.current_record: self.current_record.validate_set() From 6ad512fd7ad757f45b9e47030f31529ce4ddd93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 17 Oct 2012 21:19:22 +0200 Subject: [PATCH 74/87] Fix calls to sig_db_dump/restore issue2814 (transplanted from 2105a3798a43a68f2813a0258597c20d653c87a0) --- tryton/gui/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/gui/main.py b/tryton/gui/main.py index f329cc0612..6e93fd8c98 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -1522,7 +1522,7 @@ class Main(object): common.message(_("Database dropped successfully!"), \ parent=self.window) - def sig_db_restore(self, widget): + def sig_db_restore(self, widget=None): if not self.sig_logout(widget): return False filename = common.file_selection(_('Open Backup File to Restore...'), \ @@ -1567,7 +1567,7 @@ class Main(object): common.message(_('Database restore failed!'), \ parent=self.window) - def sig_db_dump(self, widget): + def sig_db_dump(self, widget=None): if not self.sig_logout(widget): return False dialog = DBBackupDrop(self.window, function='backup') From 6653df11b799ef0b70e9592b9f712da51e66bd45 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Sat, 20 Oct 2012 13:46:07 +0200 Subject: [PATCH 75/87] avoid markup on unknown strings issue2843 review576002 (transplanted from ee1eeb93e98c8a82678b6cf37fa44fbc1b41fd55) --- tryton/gui/window/win_form.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py index 38e178763b..e0b3ef62b8 100644 --- a/tryton/gui/window/win_form.py +++ b/tryton/gui/window/win_form.py @@ -58,9 +58,8 @@ class WinForm(object): self.win.set_title(self.screen.current_view.title) title = gtk.Label() - title.set_use_markup(True) - title.modify_font(pango.FontDescription("12")) - title.set_label('' + self.screen.current_view.title + '') + title.modify_font(pango.FontDescription("bold 12")) + title.set_label(self.screen.current_view.title) title.set_padding(20, 3) title.set_alignment(0.0, 0.5) title.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#000000")) From 0348baad9192af45c3cbbfd552e3e50588bfc56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Nov 2012 17:35:26 +0100 Subject: [PATCH 76/87] Prepare release 1.8.7 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 352e4b9332..5be79a302e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.7 - 2012-11-05 +* Bug fixes (see mercurial logs for details) + Version 1.8.6 - 2012-09-01 * Bug fixes (see mercurial logs for details) From ac6092c8d2a7848f9c33701ae5f867845fcf086c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Nov 2012 17:35:27 +0100 Subject: [PATCH 77/87] Added tag 1.8.7 for changeset d239bf9004f3 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c7e8bf2534..4cc0bb433c 100644 --- a/.hgtags +++ b/.hgtags @@ -9,3 +9,4 @@ eed0c27dabc2051a407f8bbcfb9b49f804504e70 1.8.3 7f30158dab9688a8df5783e6253a7321f298dac2 1.8.4 6bf0a9325f010d65bb27e8c6a01f7610b5031fe3 1.8.5 c4577149a154a60b6f61b7578013d6df69d57b2b 1.8.6 +d239bf9004f3a43527ec88eefe3d8daa77a0874f 1.8.7 From 14fd151f44c7a479d8e5917f85a354ffc9c46209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Nov 2012 17:36:10 +0100 Subject: [PATCH 78/87] 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 d089dfa2be..e9ea337ba4 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.7" +VERSION = "1.8.8" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From 3a30f926473f074e4846d375d4168780ef378505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 9 Dec 2012 00:11:55 +0100 Subject: [PATCH 79/87] Add missing parenthesis on test in O2M.set_on_change issue2917 (transplanted from b76788d09e04a0a80f5fccb26d5a505bdeb35c7d) --- 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 f25e07a454..3996ba66db 100644 --- a/tryton/gui/window/view_form/model/field.py +++ b/tryton/gui/window/view_form/model/field.py @@ -507,7 +507,7 @@ class O2MField(CharField): for record2 in to_remove: record.value[self.name].remove(record2, signal=False) - if value and value.get('add') or value.get('update', []): + if value and (value.get('add') or value.get('update', [])): record.value[self.name].add_fields(fields, signal=False) for vals in value.get('add', []): new_record = record.value[self.name].new(default=False, From 79d7ace48853e0aa8a310c2aec307bbcfd205b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 13 Dec 2012 19:06:01 +0100 Subject: [PATCH 80/87] Copy also tryton locale on win32 as directory is clean before issue2921 review597006 (transplanted from e5cdaf0a7ba1fd96593138d905bebe50de6c5663) --- setup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.py b/setup.py index ac918f5ccf..4e56ae4e4f 100644 --- a/setup.py +++ b/setup.py @@ -207,6 +207,11 @@ if os.name == 'nt': shutil.rmtree(os.path.join(dist_dir, 'share', 'locale', lang)) shutil.copytree(os.path.join(gtk_dir, 'share', 'locale', lang), os.path.join(dist_dir, 'share', 'locale', lang)) + if os.path.isdir(os.path.join(os.path.dirname(__file__), + 'share', 'locale', lang)): + shutil.copytree(os.path.join(os.path.dirname(__file__), + 'share', 'locale', lang), + os.path.join(dist_dir, 'share', 'locale', lang)) if os.path.isdir(os.path.join(dist_dir, 'share', 'themes', 'MS-Windows')): shutil.rmtree(os.path.join(dist_dir, 'share', 'themes', 'MS-Windows')) @@ -300,6 +305,11 @@ elif os.name == 'mac' \ shutil.rmtree(os.path.join(resources_dir, 'share', 'locale', lang)) shutil.copytree(os.path.join(gtk_dir, 'share', 'locale', lang), os.path.join(resources_dir, 'share', 'locale', lang)) + if os.path.isdir(os.path.join(os.path.dirname(__file__), + 'share', 'locale', lang)): + shutil.copytree(os.path.join(os.path.dirname(__file__), + 'share', 'locale', lang), + os.path.join(resources_dir, 'share', 'locale', lang)) # fix pathes within shared libraries for library in chain( From 2ffe975b904665be4bcc00cfd7631528662be3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 23 Dec 2012 17:03:13 +0100 Subject: [PATCH 81/87] Prepare release 1.8.8 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5be79a302e..ca39cd0c83 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.8 - 2012-12-23 +* Bug fixes (see mercurial logs for details) + Version 1.8.7 - 2012-11-05 * Bug fixes (see mercurial logs for details) From 0451e6e41ac8d03567b046fc62094f1bed4a39c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 23 Dec 2012 17:03:14 +0100 Subject: [PATCH 82/87] Added tag 1.8.8 for changeset f2b955acf98a --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 4cc0bb433c..9c342aed28 100644 --- a/.hgtags +++ b/.hgtags @@ -10,3 +10,4 @@ eed0c27dabc2051a407f8bbcfb9b49f804504e70 1.8.3 6bf0a9325f010d65bb27e8c6a01f7610b5031fe3 1.8.5 c4577149a154a60b6f61b7578013d6df69d57b2b 1.8.6 d239bf9004f3a43527ec88eefe3d8daa77a0874f 1.8.7 +f2b955acf98a9945dcedad8c2098999257e0eae0 1.8.8 From 4ce06bb66f99c72cd5056a4c3e98200f428b481c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 23 Dec 2012 17:03:46 +0100 Subject: [PATCH 83/87] 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 e9ea337ba4..c81708c31f 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.8" +VERSION = "1.8.9" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/" From f5c4be989859612e06c4e59be8cac83a9ced92c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 27 Mar 2013 22:52:48 +0100 Subject: [PATCH 84/87] Add missing initialization of bars in Bar issue3073 review730002 (transplanted from 4ce2f0028aa8ac17114588eacf668de236f9d25a) --- tryton/gui/window/view_form/view/graph_gtk/bar.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tryton/gui/window/view_form/view/graph_gtk/bar.py b/tryton/gui/window/view_form/view/graph_gtk/bar.py index a189ef0b23..807f32b11c 100644 --- a/tryton/gui/window/view_form/view/graph_gtk/bar.py +++ b/tryton/gui/window/view_form/view/graph_gtk/bar.py @@ -11,6 +11,10 @@ import tryton.rpc as rpc class Bar(Graph): + def __init__(self, *args, **kwargs): + super(Bar, self).__init__(*args, **kwargs) + self.bars = [] + def drawGraph(self, cr, width, height): def drawBar(bar): From 11bde5422531453baf17a8394bf3866848d89fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 May 2013 09:32:55 +0200 Subject: [PATCH 85/87] Prepare release 1.8.9 --- CHANGELOG | 3 +++ COPYRIGHT | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ca39cd0c83..bb5778dc5e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.8.9 - 2013-05-02 +* Bug fixes (see mercurial logs for details) + Version 1.8.8 - 2012-12-23 * Bug fixes (see mercurial logs for details) diff --git a/COPYRIGHT b/COPYRIGHT index 42e7347f4f..07584c06c4 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,6 +1,6 @@ -Copyright (C) 2007-2012 Cédric Krier. +Copyright (C) 2007-2013 Cédric Krier. Copyright (C) 2007-2011 Bertrand Chenal. -Copyright (C) 2008-2012 B2CK SPRL. +Copyright (C) 2008-2013 B2CK SPRL. Copyright (C) 2008-2011 Udo Spallek. Copyright (C) 2008-2011 virtual things - Preisler & Spallek GbR. Copyright (C) 2007-2009 Lorenzo Gil Sanchez. From 53c722a84a8f7b0ec28fb1fb386f7d0f0fff3352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 May 2013 09:32:56 +0200 Subject: [PATCH 86/87] Added tag 1.8.9 for changeset 71686189ba04 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 9c342aed28..b4cf5e9841 100644 --- a/.hgtags +++ b/.hgtags @@ -11,3 +11,4 @@ eed0c27dabc2051a407f8bbcfb9b49f804504e70 1.8.3 c4577149a154a60b6f61b7578013d6df69d57b2b 1.8.6 d239bf9004f3a43527ec88eefe3d8daa77a0874f 1.8.7 f2b955acf98a9945dcedad8c2098999257e0eae0 1.8.8 +71686189ba04482b46646fb10e1473abcdb11057 1.8.9 From a68cc1fbb57fd33ed3d083acc9954f8d50336c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 2 May 2013 09:33:16 +0200 Subject: [PATCH 87/87] 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 c81708c31f..1136cddc8c 100644 --- a/tryton/version.py +++ b/tryton/version.py @@ -1,7 +1,7 @@ #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 = "1.8.9" +VERSION = "1.8.10" LICENSE = "GPL-3" WEBSITE = "http://www.tryton.org/"