Ignore "noupdate" attribute when installing a new module

issue2854
review631004
This commit is contained in:
Cédric Krier
2013-09-20 00:36:00 +02:00
parent eccf788e74
commit 41d2aa44ea
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -389,7 +389,7 @@ class Fs2bdAccessor:
class TrytondXmlHandler(sax.handler.ContentHandler):
def __init__(self, pool, module,):
def __init__(self, pool, module, module_state):
"Register known taghandlers, and managed tags."
sax.handler.ContentHandler.__init__(self)
@@ -399,6 +399,7 @@ class TrytondXmlHandler(sax.handler.ContentHandler):
self.fs2db = Fs2bdAccessor(self.ModelData, pool)
self.to_delete = self.populate_to_delete()
self.noupdate = None
self.module_state = module_state
self.grouped = None
self.grouped_creations = defaultdict(dict)
self.skip_data = False
@@ -570,7 +571,7 @@ class TrytondXmlHandler(sax.handler.ContentHandler):
if module == self.module and fs_id in self.to_delete:
self.to_delete.remove(fs_id)
if self.noupdate:
if self.noupdate and self.module_state != 'to install':
return
# this record is already in the db:
+2 -1
View File
@@ -238,7 +238,8 @@ def load_module_graph(graph, pool, lang=None):
models_to_update_history.add(model.__name__)
#Instanciate a new parser for the package:
tryton_parser = convert.TrytondXmlHandler(pool=pool, module=module)
tryton_parser = convert.TrytondXmlHandler(pool=pool, module=module,
module_state=package_state)
for filename in package.info.get('xml', []):
filename = filename.replace('/', os.sep)