[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.
This commit is contained in:
Adrian Torres
2018-02-23 16:06:03 +01:00
committed by GitHub
parent 3ac58d44c7
commit 517b1d1faf
+1 -1
View File
@@ -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: