Module unload: workaround missing models.
If module unload asks to remove objects from missing models, just warn. bzr revid: p_christ@hol.gr-20090126202751-721lgjp2lhvlh19e
This commit is contained in:
@@ -700,7 +700,11 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
|
||||
cr.execute('select model,res_id from ir_model_data where noupdate=%s and module=%s order by id desc', (False, mod_name,))
|
||||
for rmod, rid in cr.fetchall():
|
||||
uid = 1
|
||||
pool.get(rmod).unlink(cr, uid, [rid])
|
||||
rmod_module= pool.get(rmod)
|
||||
if rmod_module:
|
||||
rmod_module.unlink(cr, uid, [rid])
|
||||
else:
|
||||
logger.notifyChannel('init', netsvc.LOG_ERROR, 'Could not locate %s to remove res=%d' % (rmod,rid))
|
||||
cr.execute('delete from ir_model_data where noupdate=%s and module=%s', (False, mod_name,))
|
||||
cr.commit()
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user