From dd0a3ea92fe6d1bb8fb0e2f7888fbdcbb7dfdf08 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 29 Jan 2016 13:18:22 +0100 Subject: [PATCH] [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`. --- openerp/addons/base/module/wizard/base_module_upgrade.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/addons/base/module/wizard/base_module_upgrade.py b/openerp/addons/base/module/wizard/base_module_upgrade.py index 5104e94a720..5d0bd0f79d0 100644 --- a/openerp/addons/base/module/wizard/base_module_upgrade.py +++ b/openerp/addons/base/module/wizard/base_module_upgrade.py @@ -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)