-
-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy pathhooks.py
More file actions
29 lines (21 loc) · 845 Bytes
/
hooks.py
File metadata and controls
29 lines (21 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
from odoo import api
OLD_MODULE_NAME = "l10n_it_ricevute_bancarie"
NEW_MODULE_NAME = "l10n_it_riba"
def pre_absorb_old_module(env):
if openupgrade.is_module_installed(env.cr, "l10n_it_riba"):
openupgrade.update_module_names(
env.cr,
[
("l10n_it_riba", "l10n_it_riba_oca"),
],
merge_modules=True,
)
def migrate_old_module(cr):
"""Migration wrapper to absorb old l10n_it_riba module into l10n_it_riba_oca.
Called from pre-migration script with cursor-only access.
Creates an env from cr and delegates to pre_absorb_old_module.
"""
env = api.Environment(cr, 1, {}) # uid=1 (admin), empty context
pre_absorb_old_module(env)