Fix trying to remove inherited object with xml_id on install/update

bzr revid: ced-f459bef982db368f854fbe4396a1383388ff1b62
This commit is contained in:
ced
2007-12-28 09:48:59 +00:00
parent cef4c07970
commit a6ae9cbd5e
+7
View File
@@ -255,6 +255,13 @@ class ir_model_data(osv.osv):
if xml_id:
if res_id:
self.loads[(module, xml_id)] = (model, res_id)
if model_obj._inherits:
for table in model_obj._inherits:
inherit_field = model_obj._inherits[table]
inherit_id = model_obj.read(cr, uid, res_id,
[inherit_field])[inherit_field]
self.loads[(module, xml_id + '_' + \
table.replace('.', '_'))] = (table, inherit_id)
return res_id
def _unlink(self, cr, uid, model, ids, direct=False):