Reviewers: ,
Please review this at http://codereview.tryton.org/631004/
Affected files:
M trytond/convert.py
M trytond/modules/__init__.py
Index: trytond/convert.py
===================================================================
--- a/trytond/convert.py
+++ b/trytond/convert.py
@@ -372,7 +372,7 @@
class TrytondXmlHandler(sax.handler.ContentHandler):
- def __init__(self, pool, module,):
+ def __init__(self, pool, module, to_install=False):
"Register known taghandlers, and managed tags."
sax.handler.ContentHandler.__init__(self)
@@ -382,6 +382,7 @@
self.fs2db = Fs2bdAccessor(self.ModelData, pool)
self.to_delete = self.populate_to_delete()
self.noupdate = None
+ self.to_install = to_install
self.skip_data = False
# Tag handlders are used to delegate the processing
@@ -550,7 +551,7 @@
if module == self.module and fs_id in self.to_delete:
self.to_delete.remove(fs_id)
- if self.noupdate:
+ if self.noupdate and not self.to_install:
return
# this record is already in the db:
Index: trytond/modules/__init__.py
===================================================================
--- a/trytond/modules/__init__.py
+++ b/trytond/modules/__init__.py
@@ -232,7 +232,8 @@
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,
+ to_install=(package_state == 'to install'))
for filename in package.info.get('xml', []):
filename = filename.replace('/', os.sep)
--
--
[email protected] mailing list