From 517b1d1faf97a8c4866a8bebcb13afa90f08771f Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Fri, 23 Feb 2018 16:06:03 +0100 Subject: [PATCH] [FIX] sale: re-init account.invoice.report view (#23286) * Install sale_management, contacts * Uninstall sale (not sale_management) * Try to access any partner via contacts -> BOOM, traceback: relation account_invoice_report does not exist For some reason, uninstalling `sale` drops the SQL view for account.invoice.report which in turn means that anything that requires the view will break, this was the case for accessing the res_partner form view. Fixes #23270 by forcing account.invoice.report.init() upon uninstallation of the `sale` module. --- addons/sale/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py index ba3e6977f3c..0b45acc7630 100644 --- a/addons/sale/__init__.py +++ b/addons/sale/__init__.py @@ -11,12 +11,12 @@ import odoo from odoo import api, SUPERUSER_ID - def uninstall_hook(cr, registry): def update_dashboard_graph_model(dbname): db_registry = odoo.modules.registry.Registry.new(dbname) with api.Environment.manage(), db_registry.cursor() as cr: env = api.Environment(cr, SUPERUSER_ID, {}) + env['account.invoice.report'].init() if 'crm.team' in env: recs = env['crm.team'].search([]) for rec in recs: