2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-01-16 11:34:37 +01:00
|
|
|
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
from functools import partial
|
2017-10-27 08:04:41 +02:00
|
|
|
import flectra
|
|
|
|
from flectra import api, SUPERUSER_ID
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
from . import models # noqa
|
|
|
|
from . import report # noqa
|
|
|
|
|
|
|
|
|
|
|
|
def uninstall_hook(cr, registry):
|
|
|
|
def recreate_view(dbname):
|
|
|
|
db_registry = openerp.modules.registry.Registry.new(dbname)
|
|
|
|
with api.Environment.manage(), db_registry.cursor() as cr:
|
|
|
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
|
|
|
if 'sale.report' in env:
|
|
|
|
env['sale.report'].init()
|
|
|
|
|
|
|
|
cr.after("commit", partial(recreate_view, cr.dbname))
|