Skip to content

Commit

Permalink
[FIX] sale: re-init account.invoice.report view (#23286)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Adrian Torres committed Feb 23, 2018
1 parent 3ac58d4 commit 517b1d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/sale/__init__.py
Expand Up @@ -11,12 +11,12 @@
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:
Expand Down

0 comments on commit 517b1d1

Please sign in to comment.