Skip to content

Commit f24f853

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

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2021 ForgeFlow S.L. <https://www.forgeflow.com>
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+
13+
def change_owner_group_fiscal_year(env):
14+
"""When installing om_account_accountant, got a conflict duplicated group group_fiscal_year
15+
"""
16+
imd = env['ir.model.data'].sudo()
17+
# Remove any stale/duplicate mapping of the old XMLID
18+
imd.search([
19+
('module', '=', 'account'),
20+
('name', '=', 'group_fiscal_year'),
21+
('model', '=', 'res.groups'),
22+
]).unlink()
23+
imd = env['res.groups'].sudo()
24+
# Remove any stale/duplicate mapping of the old XMLID
25+
imd.search([
26+
('name', '=', 'Allow to define fiscal years of more or less than a year'),
27+
]).unlink()
28+
29+
30+
@openupgrade.migrate()
31+
def migrate(env, version):
32+
change_owner_group_fiscal_year(env)

0 commit comments

Comments
 (0)