Skip to content

Commit 62ef3c0

Browse files
committed
[ADD] ERPLibre odoo 14 migration om_account_accountant
1 parent 7383f08 commit 62ef3c0

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2025 TechnoLibre <https://technolibre.ca>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
import logging
4+
5+
from openupgradelib import openupgrade
6+
7+
from odoo.tools.translate import _
8+
9+
_logger = logging.getLogger(__name__)
10+
11+
12+
def change_owner_group_fiscal_year(env):
13+
"""When installing om_account_accountant, got a conflict duplicated group group_fiscal_year"""
14+
imd = env["ir.model.data"].sudo()
15+
# Remove any stale/duplicate mapping of the old XMLID
16+
imd.search(
17+
[
18+
("module", "=", "account"),
19+
("name", "=", "group_fiscal_year"),
20+
("model", "=", "res.groups"),
21+
]
22+
).unlink()
23+
imd = env["res.groups"].sudo()
24+
# Remove any stale/duplicate mapping of the old XMLID
25+
imd.search(
26+
[
27+
(
28+
"name",
29+
"=",
30+
"Allow to define fiscal years of more or less than a year",
31+
),
32+
]
33+
).unlink()
34+
35+
36+
@openupgrade.migrate()
37+
def migrate(env, version):
38+
change_owner_group_fiscal_year(env)

0 commit comments

Comments
 (0)