[FIX] do no update <record> with the "noupdate" flag

[FIX] import_partial was broken

bzr revid: christophe@cobalt-20081222105106-or8sen6srt8ao0zf
This commit is contained in:
Christophe Simonis 2008-12-22 11:51:06 +01:00
parent 7411a4cb51
commit 66ea8170e0
1 changed files with 2 additions and 5 deletions

View File

@ -662,10 +662,7 @@ form: module.record_id""" % (xml_id,)
rec_id = rec.getAttribute("id").encode('ascii')
self._test_xml_id(rec_id)
# if not rec_id and not self.isnoupdate(data_node):
# print "Warning", rec_model
if self.isnoupdate(data_node) and not self.mode in ('init','update'):
if self.isnoupdate(data_node) and self.mode != 'init':
# check if the xml record has an id string
if rec_id:
id = self.pool.get('ir.model.data')._update_dummy(cr, self.uid, rec_model, self.module, rec_id)
@ -730,7 +727,7 @@ form: module.record_id""" % (xml_id,)
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode )
if rec_id:
self.idref[rec_id] = int(id)
if config.get('i mport_partial', False):
if config.get('import_partial', False):
cr.commit()
return rec_model, id