summaryrefslogtreecommitdiff
path: root/openerp/addons/base/module/wizard/base_module_upgrade.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2016-01-29 13:18:22 +0100
committerRaphael Collet <rco@openerp.com>2016-02-04 15:52:06 +0100
commitdd0a3ea92fe6d1bb8fb0e2f7888fbdcbb7dfdf08 (patch)
treeca30af7c154158dbc01e6e324895035d8c65381b /openerp/addons/base/module/wizard/base_module_upgrade.py
parent34cba4e0e54d866a17bc2cad1af1f037974362ac (diff)
[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`.
Diffstat (limited to 'openerp/addons/base/module/wizard/base_module_upgrade.py')
-rw-r--r--openerp/addons/base/module/wizard/base_module_upgrade.py3
1 files changed, 2 insertions, 1 deletions
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)