File tree Expand file tree Collapse file tree
openupgrade_scripts/scripts/om_account_accountant/14.0.8.1.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments