From 3d1f0da70d1d4be91900f87a3bda411ce242011d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 29 Feb 2008 13:16:58 +0100 Subject: [PATCH 1/5] Run config wizard after module install --- trytond/ir/module/module.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/trytond/ir/module/module.py b/trytond/ir/module/module.py index 0e5e0f7665..cf19a5bbb6 100644 --- a/trytond/ir/module/module.py +++ b/trytond/ir/module/module.py @@ -679,10 +679,23 @@ class ModuleInstallUpgrade(Wizard): 'type': 'form', 'object': 'ir.module.module.install_upgrade.start', 'state': [ - ('end', 'Close', 'gtk-close', True), + ('config', 'Ok', 'gtk-ok', True), ], }, }, + 'config': { + 'result': { + 'type': 'action', + 'action': '_config', + 'state': 'end', + }, + }, } + def _config(self, cursor, user, data, context=None): + return { + 'type': 'ir.action.wizard', + 'wiz_name': 'ir.module.module.config_wizard', + } + ModuleInstallUpgrade() From 018f2031584d2fef836e88d50be927a38c04d25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 29 Feb 2008 15:52:06 +0100 Subject: [PATCH 2/5] Add unique constraint on xml id --- trytond/tools/convert.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trytond/tools/convert.py b/trytond/tools/convert.py index 5563c23102..771204c466 100644 --- a/trytond/tools/convert.py +++ b/trytond/tools/convert.py @@ -144,6 +144,8 @@ class RecordTagHandler: def __init__(self, master_handler): # Remind reference of parent handler self.mh = master_handler + # stock xml_id parsed in one module + self.xml_ids = [] def startElement(self, name, attributes): @@ -258,9 +260,11 @@ class RecordTagHandler: return self elif name == "record": + if self.xml_id in self.xml_ids: + raise Exception('Duplicate id: "%s".' % (self.xml_id,)) res = self.mh.import_record( self.model._name, self.values, self.xml_id) - + self.xml_ids.append(self.xml_id) return None else: raise Exception("Unexpected closing tag '%s'"% (name,)) @@ -587,7 +591,7 @@ class TrytondXmlHandler(sax.handler.ContentHandler): # Remove this record from the to_delete list. This means that # the corresponding record have been found. - if module == self.module: + if module == self.module and fs_id in self.to_delete: self.to_delete.remove(fs_id) else: # this record is new, create it in the db: From c4e32a1eebdc3134cc20dc1f0f91faf65a5d719a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 29 Feb 2008 16:06:42 +0100 Subject: [PATCH 3/5] Don't add {create,write}_{uid,date} fields in default view --- trytond/osv/orm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index d008e05a6d..a656a58840 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -1903,6 +1903,8 @@ class ORM(object): xml = '''''' \ '''
''' % (self._description,) for i in res: + if i in ('create_uid', 'create_date', 'write_uid', 'write_date'): + continue if res[i]['type'] not in ('one2many', 'many2many'): xml += '