From bfa9ea99e377000edd1dfce38bdd2234f440bc3b Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 30 Nov 2009 14:11:25 +0530 Subject: [PATCH] [FIX] Module informtion was not getting updated on upgrading module lp bug: https://launchpad.net/bugs/487723 fixed bzr revid: jvo@tinyerp.com-20091130084125-1kqrxbdti3a6jxga --- bin/addons/__init__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index 11503306743..0ac375fcde1 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -82,7 +82,7 @@ class Graph(dict): ## and we update the default values with values from the database additional_data.update(dict([(x.pop('name'), x) for x in cr.dictfetchall()])) - + for package in self.values(): for k, v in additional_data[package.name].items(): setattr(package, k, v) @@ -602,6 +602,16 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): has_updates = True for kind in ('init', 'update'): + if package.state=='to upgrade': + # upgrading the module information + modobj.write(cr, 1, [mid], { + 'description': package.data.get('description', ''), + 'shortdesc': package.data.get('name', ''), + 'author': package.data.get('author', 'Unknown'), + 'website': package.data.get('website', ''), + 'license': package.data.get('license', 'GPL-2'), + 'certificate': package.data.get('certificate') or None, + }) for filename in package.data.get('%s_xml' % kind, []): logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, filename)) name, ext = os.path.splitext(filename)