Skip to content

Commit 58251a9

Browse files
committed
[FIX] l10n_it_riba_oca: fix scripts for OpenUpgrade migration
1 parent 0373e56 commit 58251a9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

l10n_it_riba_oca/hooks.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from openupgradelib import openupgrade
44

5+
from odoo import api
6+
57
OLD_MODULE_NAME = "l10n_it_ricevute_bancarie"
68
NEW_MODULE_NAME = "l10n_it_riba"
79

@@ -15,3 +17,13 @@ def pre_absorb_old_module(env):
1517
],
1618
merge_modules=True,
1719
)
20+
21+
22+
def migrate_old_module(cr):
23+
"""Migration wrapper to absorb old l10n_it_riba module into l10n_it_riba_oca.
24+
25+
Called from pre-migration script with cursor-only access.
26+
Creates an env from cr and delegates to pre_absorb_old_module.
27+
"""
28+
env = api.Environment(cr, 1, {}) # uid=1 (admin), empty context
29+
pre_absorb_old_module(env)

l10n_it_riba_oca/migrations/18.0.1.0.0/pre-migrate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
from odoo.addons.l10n_it_riba_oca import hooks
1212

1313

14-
def migrate(cr, installed_version):
14+
def migrate(cr, version):
1515
# Used by OpenUpgrade when module is in `apriori`
1616
hooks.migrate_old_module(cr)

0 commit comments

Comments
 (0)