[FIX] base: in upgrade wizard, commit transaction before reloading registry

Not committing the current transaction may block the deinstallation of a
module.  Specifically, if a module adds a field on model `ir.module.module`,
its deinstallation will block when trying to remove the column, because the
wizard's pending transaction made a query on the table `ir_module_module`.
This commit is contained in:
Raphael Collet
2016-02-04 15:52:06 +01:00
parent 34cba4e0e5
commit dd0a3ea92f
@@ -81,8 +81,9 @@ class base_module_upgrade(osv.osv_memory):
raise UserError(_('Following modules are not installed or unknown: %s') % ('\n\n' + '\n'.join(unmet_packages)))
ir_module.download(cr, uid, ids, context=context)
cr.commit() # save before re-creating cursor below
# terminate transaction before re-creating cursor below
cr.commit()
openerp.api.Environment.reset()
openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)