summaryrefslogtreecommitdiff
path: root/odoo/modules/loading.py
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2018-03-13 09:41:43 +0100
committerGitHub <noreply@github.com>2018-03-13 09:41:43 +0100
commit84b6c46943f20b8dc77b390627fbfefa6a181327 (patch)
tree6ed6c5c1da3f5f2f98e2c1e143cf968f9dddc6b1 /odoo/modules/loading.py
parent31a0bdec73adb09455e6a30a67d8ba23242b6787 (diff)
[FIX] registry, loading: re-init inherited SQL views
Before this commit: * Install any module that creates a SQL view and another that extends this view. e.g.: sale and pos_sale for `report.all.channels.sales`. * Uninstall the module that extended the SQL view. e.g.: uninstall pos_sale. * Try to access the view from the web client -> Traceback, table not found. This happens because when reloading the registry, postgres drops the sql view and it must be re-initialized. After this commit: We solve this issue by calculating all missing tables/views during the uninstallation process, and re-initializing all of them right before reloading the registry. Also remove sql-view hacks in the modules `sale` and `sale_margin`. Fixes #23528, #23529, #23530
Diffstat (limited to 'odoo/modules/loading.py')
-rw-r--r--odoo/modules/loading.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py
index 81c90e2b728..426ec9bb653 100644
--- a/odoo/modules/loading.py
+++ b/odoo/modules/loading.py
@@ -403,7 +403,12 @@ def load_modules(db, force_demo=False, status=None, update_module=False):
cr.commit()
_logger.info('Reloading registry once more after uninstalling modules')
api.Environment.reset()
- return odoo.modules.registry.Registry.new(cr.dbname, force_demo, status, update_module)
+ registry = odoo.modules.registry.Registry.new(
+ cr.dbname, force_demo, status, update_module
+ )
+ registry.check_tables_exist(cr)
+ cr.commit()
+ return registry
# STEP 6: verify custom views on every model
if update_module: