diff --git a/l10n_it_financial_statement_eu/__init__.py b/l10n_it_financial_statement_eu/__init__.py index a5129afc163c..9910ae178780 100644 --- a/l10n_it_financial_statement_eu/__init__.py +++ b/l10n_it_financial_statement_eu/__init__.py @@ -3,199 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models -from . import wizard from . import report +from . import wizard -from odoo import api, SUPERUSER_ID - - -def _l10n_it_financial_statement_eu_post_init(cr, registry): - env = api.Environment(cr, SUPERUSER_ID, {}) - fse = env["financial.statement.eu"] - fse.financial_statement_eu_account_assoc_code("1101%", "PA.B11a", False) - fse.financial_statement_eu_account_assoc_code("1106%", "PA.B13a", False) - fse.financial_statement_eu_account_assoc_code("1108%", "PA.B15a", False) - fse.financial_statement_eu_account_assoc_code("1111%", "PA.B11b", False) - fse.financial_statement_eu_account_assoc_code("1116%", "PA.B13b", False) - fse.financial_statement_eu_account_assoc_code("1118%", "PA.B15b", False) - fse.financial_statement_eu_account_assoc_code("1201%", "PA.B21a", False) - fse.financial_statement_eu_account_assoc_code("1202%", "PA.B22a", False) - fse.financial_statement_eu_account_assoc_code("1204%", "PA.B23a", False) - fse.financial_statement_eu_account_assoc_code("1205%", "PA.B24a", False) - fse.financial_statement_eu_account_assoc_code("1206%", "PA.B24a", False) - fse.financial_statement_eu_account_assoc_code("1207%", "PA.B24a", False) - fse.financial_statement_eu_account_assoc_code("1208%", "PA.B24a", False) - fse.financial_statement_eu_account_assoc_code("1211%", "PA.B21b", False) - fse.financial_statement_eu_account_assoc_code("1212%", "PA.B22b", False) - fse.financial_statement_eu_account_assoc_code("1214%", "PA.B23b", False) - fse.financial_statement_eu_account_assoc_code("1215%", "PA.B24b", False) - fse.financial_statement_eu_account_assoc_code("1216%", "PA.B24b", False) - fse.financial_statement_eu_account_assoc_code("1217%", "PA.B24b", False) - fse.financial_statement_eu_account_assoc_code("1218%", "PA.B24b", False) - fse.financial_statement_eu_account_assoc_code("1220%", "PA.B25", False) - fse.financial_statement_eu_account_assoc_code("130100", "PA.B32d1", False) - fse.financial_statement_eu_account_assoc_code("1302%", "PA.B31d", False) - fse.financial_statement_eu_account_assoc_code("1401%", "PA.C11", False) - fse.financial_statement_eu_account_assoc_code("1404%", "PA.C11", False) - fse.financial_statement_eu_account_assoc_code("1410%", "PA.C25a", False) - fse.financial_statement_eu_account_assoc_code("1501%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1502%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1503%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1505%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1506%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1507%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1508%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1509%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1510%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1511%", "PA.C21a", False) - fse.financial_statement_eu_account_assoc_code("1531%", "PA.C25a", False) - fse.financial_statement_eu_account_assoc_code("1540%", "PA.C25a", False) - fse.financial_statement_eu_account_assoc_code("1541%", "PA.C25a", False) - fse.financial_statement_eu_account_assoc_code("1601%", "PA.C2Ba", False) - fse.financial_statement_eu_account_assoc_code("1602%", "PA.C2Ba", False) - fse.financial_statement_eu_account_assoc_code("1605%", "PA.C2Ba", False) - fse.financial_statement_eu_account_assoc_code("1607%", "PA.C2T", False) - fse.financial_statement_eu_account_assoc_code("1608%", "PA.C2Ba", False) - fse.financial_statement_eu_account_assoc_code("1609%", "PA.C2Ba", False) - fse.financial_statement_eu_account_assoc_code("1610%", "PA.C2Ba", False) - fse.financial_statement_eu_account_assoc_code("1620%", "PA.C25a", False) - fse.financial_statement_eu_account_assoc_code("1630%", "PA.C25a", False) - fse.financial_statement_eu_account_assoc_code("1640%", "PA.C25a", False) - # accounts 1701% not present in the basic chart of accounts - fse.financial_statement_eu_account_assoc_code("1701%", "PA.C36", False) - fse.financial_statement_eu_account_assoc_code("1800%", "PA.C43", False) - fse.financial_statement_eu_account_assoc_code("182%", "PA.C41", "PP.D3a") - fse.financial_statement_eu_account_assoc_code("183001", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("1901%", "PA.D", "PP.E") - fse.financial_statement_eu_account_assoc_code("1902%", "PA.D", "PP.E") - fse.financial_statement_eu_account_assoc_code("210100", "PP.A1", False) - # other no standard 2101% may need to be associated with other codes - fse.financial_statement_eu_account_assoc_code("2102%", "PP=A9", False) - fse.financial_statement_eu_account_assoc_code("2103%", "PP=A9", False) - fse.financial_statement_eu_account_assoc_code("2104%", "PP.B2", False) - fse.financial_statement_eu_account_assoc_code("2105%", "PP.B2", False) - fse.financial_statement_eu_account_assoc_code("2201%", "PP.B2", False) - fse.financial_statement_eu_account_assoc_code("2204%", "PP.B2", False) - fse.financial_statement_eu_account_assoc_code("2205%", "PP.B3", False) - fse.financial_statement_eu_account_assoc_code("2211%", "PP.B3", False) - fse.financial_statement_eu_account_assoc_code("2301%", "PP.C", False) - fse.financial_statement_eu_account_assoc_code("2410%", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("2411%", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("2420%", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("2421%", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("2422%", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("2423%", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("2440%", "PP.D3a", False) - fse.financial_statement_eu_account_assoc_code("2501%", "PP.D6a", False) - fse.financial_statement_eu_account_assoc_code("2503%", "PP.D6a", False) - fse.financial_statement_eu_account_assoc_code("2520%", "PP.D6a", False) - fse.financial_statement_eu_account_assoc_code("2521%", "PP.D6a", False) - fse.financial_statement_eu_account_assoc_code("2530%", "PP.D6a", False) - fse.financial_statement_eu_account_assoc_code("2601%", "PP.DBa", False) - fse.financial_statement_eu_account_assoc_code("2602%", "PP.DBa", False) - fse.financial_statement_eu_account_assoc_code("2605%", "PP.DBa", False) - fse.financial_statement_eu_account_assoc_code("2606%", "PA.C2Ba", "PP.DBa") - fse.financial_statement_eu_account_assoc_code("2619%", "PP.DBa", False) - fse.financial_statement_eu_account_assoc_code("2620%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2621%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2622%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2630%", "PP.DCa", False) - fse.financial_statement_eu_account_assoc_code("2640%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2701%", "PP.E", False) - fse.financial_statement_eu_account_assoc_code("2702%", "PP.E", False) - fse.financial_statement_eu_account_assoc_code("2810%", "PP.DBa", False) - fse.financial_statement_eu_account_assoc_code("2811%", "PP.DBa", False) - fse.financial_statement_eu_account_assoc_code("2901%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2902%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2911%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2912%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2913%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2914%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2916%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2917%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2921%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2922%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2926%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2927%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2931%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("2932%", "PP.DDa", False) - fse.financial_statement_eu_account_assoc_code("3101%", "E.A1", False) - fse.financial_statement_eu_account_assoc_code("3103%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3110%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3111%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3112%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3201%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3202%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3210%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3220%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3230%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("3240%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("4101%", "E.B1", False) - fse.financial_statement_eu_account_assoc_code("4102%", "E.B1", False) - fse.financial_statement_eu_account_assoc_code("4105%", "E.B1", False) - fse.financial_statement_eu_account_assoc_code("4110%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4111%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4112%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4121%", "E.B6", False) - fse.financial_statement_eu_account_assoc_code("4122%", "E.B6", False) - fse.financial_statement_eu_account_assoc_code("4131%", "E.A2", False) - fse.financial_statement_eu_account_assoc_code("4132%", "E.A2", False) - fse.financial_statement_eu_account_assoc_code("4201%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4202%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4203%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4204%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4205%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4206%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4207%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4208%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4209%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4210%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4211%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4212%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4213%", "E.B2", False) - fse.financial_statement_eu_account_assoc_code("4301%", "E.B3", False) - fse.financial_statement_eu_account_assoc_code("4302%", "E.B3", False) - fse.financial_statement_eu_account_assoc_code("4401%", "E.B41", False) - fse.financial_statement_eu_account_assoc_code("4402%", "E.B42", False) - fse.financial_statement_eu_account_assoc_code("4403%", "E.B43", False) - fse.financial_statement_eu_account_assoc_code("4404%", "E.B45", False) - fse.financial_statement_eu_account_assoc_code("4501%", "E.B51", False) - fse.financial_statement_eu_account_assoc_code("4506%", "E.B51", False) - fse.financial_statement_eu_account_assoc_code("4508%", "E.B51", False) - fse.financial_statement_eu_account_assoc_code("4601%", "E.B52", False) - fse.financial_statement_eu_account_assoc_code("4602%", "E.B52", False) - fse.financial_statement_eu_account_assoc_code("4604%", "E.B52", False) - fse.financial_statement_eu_account_assoc_code("4605%", "E.B52", False) - fse.financial_statement_eu_account_assoc_code("4606%", "E.B52", False) - fse.financial_statement_eu_account_assoc_code("4607%", "E.B52", False) - fse.financial_statement_eu_account_assoc_code("4608%", "E.B52", False) - fse.financial_statement_eu_account_assoc_code("4701%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4702%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4706%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4814%", "E.B7", False) - fse.financial_statement_eu_account_assoc_code("4821%", "E.B7", False) - fse.financial_statement_eu_account_assoc_code("4823%", "E.B8", False) - fse.financial_statement_eu_account_assoc_code("4901%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4903%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4905%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4910%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4920%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4930%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("4940%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("5110%", "E.C244", False) - fse.financial_statement_eu_account_assoc_code("5115%", "E.C244", False) - fse.financial_statement_eu_account_assoc_code("5116%", "E.C215", False) - fse.financial_statement_eu_account_assoc_code("5140%", "E.C23", False) - fse.financial_statement_eu_account_assoc_code("5201%", "E.C35", False) - fse.financial_statement_eu_account_assoc_code("5202%", "E.C35", False) - fse.financial_statement_eu_account_assoc_code("5203%", "E.C35", False) - fse.financial_statement_eu_account_assoc_code("5210%", "E.C35", False) - fse.financial_statement_eu_account_assoc_code("5240%", "E.C35", False) - fse.financial_statement_eu_account_assoc_code("7101%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("7102%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("7103%", "E.A511", False) - fse.financial_statement_eu_account_assoc_code("7201%", "E.D23", False) - fse.financial_statement_eu_account_assoc_code("7202%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("7203%", "E.B9", False) - fse.financial_statement_eu_account_assoc_code("7204%", "E.F5", False) - fse.financial_statement_eu_account_assoc_code("8101%", "E_F1", False) +from .hooks import _l10n_it_financial_statement_eu_post_init diff --git a/l10n_it_financial_statement_eu/hooks.py b/l10n_it_financial_statement_eu/hooks.py new file mode 100644 index 000000000000..1768c92bcf03 --- /dev/null +++ b/l10n_it_financial_statement_eu/hooks.py @@ -0,0 +1,196 @@ +# Copyright 2023 MKT SRL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import SUPERUSER_ID, api + + +def _l10n_it_financial_statement_eu_post_init(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + fse = env["financial.statement.eu"] + fse.financial_statement_eu_account_assoc_code("1101%", "PA.B11a", False) + fse.financial_statement_eu_account_assoc_code("1106%", "PA.B13a", False) + fse.financial_statement_eu_account_assoc_code("1108%", "PA.B15a", False) + fse.financial_statement_eu_account_assoc_code("1111%", "PA.B11b", False) + fse.financial_statement_eu_account_assoc_code("1116%", "PA.B13b", False) + fse.financial_statement_eu_account_assoc_code("1118%", "PA.B15b", False) + fse.financial_statement_eu_account_assoc_code("1201%", "PA.B21a", False) + fse.financial_statement_eu_account_assoc_code("1202%", "PA.B22a", False) + fse.financial_statement_eu_account_assoc_code("1204%", "PA.B23a", False) + fse.financial_statement_eu_account_assoc_code("1205%", "PA.B24a", False) + fse.financial_statement_eu_account_assoc_code("1206%", "PA.B24a", False) + fse.financial_statement_eu_account_assoc_code("1207%", "PA.B24a", False) + fse.financial_statement_eu_account_assoc_code("1208%", "PA.B24a", False) + fse.financial_statement_eu_account_assoc_code("1211%", "PA.B21b", False) + fse.financial_statement_eu_account_assoc_code("1212%", "PA.B22b", False) + fse.financial_statement_eu_account_assoc_code("1214%", "PA.B23b", False) + fse.financial_statement_eu_account_assoc_code("1215%", "PA.B24b", False) + fse.financial_statement_eu_account_assoc_code("1216%", "PA.B24b", False) + fse.financial_statement_eu_account_assoc_code("1217%", "PA.B24b", False) + fse.financial_statement_eu_account_assoc_code("1218%", "PA.B24b", False) + fse.financial_statement_eu_account_assoc_code("1220%", "PA.B25", False) + fse.financial_statement_eu_account_assoc_code("130100", "PA.B32d1", False) + fse.financial_statement_eu_account_assoc_code("1302%", "PA.B31d", False) + fse.financial_statement_eu_account_assoc_code("1401%", "PA.C11", False) + fse.financial_statement_eu_account_assoc_code("1404%", "PA.C11", False) + fse.financial_statement_eu_account_assoc_code("1410%", "PA.C25a", False) + fse.financial_statement_eu_account_assoc_code("1501%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1502%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1503%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1505%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1506%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1507%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1508%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1509%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1510%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1511%", "PA.C21a", False) + fse.financial_statement_eu_account_assoc_code("1531%", "PA.C25a", False) + fse.financial_statement_eu_account_assoc_code("1540%", "PA.C25a", False) + fse.financial_statement_eu_account_assoc_code("1541%", "PA.C25a", False) + fse.financial_statement_eu_account_assoc_code("1601%", "PA.C2Ba", False) + fse.financial_statement_eu_account_assoc_code("1602%", "PA.C2Ba", False) + fse.financial_statement_eu_account_assoc_code("1605%", "PA.C2Ba", False) + fse.financial_statement_eu_account_assoc_code("1607%", "PA.C2T", False) + fse.financial_statement_eu_account_assoc_code("1608%", "PA.C2Ba", False) + fse.financial_statement_eu_account_assoc_code("1609%", "PA.C2Ba", False) + fse.financial_statement_eu_account_assoc_code("1610%", "PA.C2Ba", False) + fse.financial_statement_eu_account_assoc_code("1620%", "PA.C25a", False) + fse.financial_statement_eu_account_assoc_code("1630%", "PA.C25a", False) + fse.financial_statement_eu_account_assoc_code("1640%", "PA.C25a", False) + # accounts 1701% not present in the basic chart of accounts + fse.financial_statement_eu_account_assoc_code("1701%", "PA.C36", False) + fse.financial_statement_eu_account_assoc_code("1800%", "PA.C43", False) + fse.financial_statement_eu_account_assoc_code("182%", "PA.C41", "PP.D3a") + fse.financial_statement_eu_account_assoc_code("183001", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("1901%", "PA.D", "PP.E") + fse.financial_statement_eu_account_assoc_code("1902%", "PA.D", "PP.E") + fse.financial_statement_eu_account_assoc_code("210100", "PP.A1", False) + # other no standard 2101% may need to be associated with other codes + fse.financial_statement_eu_account_assoc_code("2102%", "PP=A9", False) + fse.financial_statement_eu_account_assoc_code("2103%", "PP=A9", False) + fse.financial_statement_eu_account_assoc_code("2104%", "PP.B2", False) + fse.financial_statement_eu_account_assoc_code("2105%", "PP.B2", False) + fse.financial_statement_eu_account_assoc_code("2201%", "PP.B2", False) + fse.financial_statement_eu_account_assoc_code("2204%", "PP.B2", False) + fse.financial_statement_eu_account_assoc_code("2205%", "PP.B3", False) + fse.financial_statement_eu_account_assoc_code("2211%", "PP.B3", False) + fse.financial_statement_eu_account_assoc_code("2301%", "PP.C", False) + fse.financial_statement_eu_account_assoc_code("2410%", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("2411%", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("2420%", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("2421%", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("2422%", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("2423%", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("2440%", "PP.D3a", False) + fse.financial_statement_eu_account_assoc_code("2501%", "PP.D6a", False) + fse.financial_statement_eu_account_assoc_code("2503%", "PP.D6a", False) + fse.financial_statement_eu_account_assoc_code("2520%", "PP.D6a", False) + fse.financial_statement_eu_account_assoc_code("2521%", "PP.D6a", False) + fse.financial_statement_eu_account_assoc_code("2530%", "PP.D6a", False) + fse.financial_statement_eu_account_assoc_code("2601%", "PP.DBa", False) + fse.financial_statement_eu_account_assoc_code("2602%", "PP.DBa", False) + fse.financial_statement_eu_account_assoc_code("2605%", "PP.DBa", False) + fse.financial_statement_eu_account_assoc_code("2606%", "PA.C2Ba", "PP.DBa") + fse.financial_statement_eu_account_assoc_code("2619%", "PP.DBa", False) + fse.financial_statement_eu_account_assoc_code("2620%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2621%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2622%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2630%", "PP.DCa", False) + fse.financial_statement_eu_account_assoc_code("2640%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2701%", "PP.E", False) + fse.financial_statement_eu_account_assoc_code("2702%", "PP.E", False) + fse.financial_statement_eu_account_assoc_code("2810%", "PP.DBa", False) + fse.financial_statement_eu_account_assoc_code("2811%", "PP.DBa", False) + fse.financial_statement_eu_account_assoc_code("2901%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2902%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2911%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2912%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2913%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2914%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2916%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2917%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2921%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2922%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2926%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2927%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2931%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("2932%", "PP.DDa", False) + fse.financial_statement_eu_account_assoc_code("3101%", "E.A1", False) + fse.financial_statement_eu_account_assoc_code("3103%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3110%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3111%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3112%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3201%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3202%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3210%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3220%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3230%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("3240%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("4101%", "E.B1", False) + fse.financial_statement_eu_account_assoc_code("4102%", "E.B1", False) + fse.financial_statement_eu_account_assoc_code("4105%", "E.B1", False) + fse.financial_statement_eu_account_assoc_code("4110%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4111%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4112%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4121%", "E.B6", False) + fse.financial_statement_eu_account_assoc_code("4122%", "E.B6", False) + fse.financial_statement_eu_account_assoc_code("4131%", "E.A2", False) + fse.financial_statement_eu_account_assoc_code("4132%", "E.A2", False) + fse.financial_statement_eu_account_assoc_code("4201%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4202%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4203%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4204%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4205%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4206%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4207%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4208%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4209%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4210%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4211%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4212%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4213%", "E.B2", False) + fse.financial_statement_eu_account_assoc_code("4301%", "E.B3", False) + fse.financial_statement_eu_account_assoc_code("4302%", "E.B3", False) + fse.financial_statement_eu_account_assoc_code("4401%", "E.B41", False) + fse.financial_statement_eu_account_assoc_code("4402%", "E.B42", False) + fse.financial_statement_eu_account_assoc_code("4403%", "E.B43", False) + fse.financial_statement_eu_account_assoc_code("4404%", "E.B45", False) + fse.financial_statement_eu_account_assoc_code("4501%", "E.B51", False) + fse.financial_statement_eu_account_assoc_code("4506%", "E.B51", False) + fse.financial_statement_eu_account_assoc_code("4508%", "E.B51", False) + fse.financial_statement_eu_account_assoc_code("4601%", "E.B52", False) + fse.financial_statement_eu_account_assoc_code("4602%", "E.B52", False) + fse.financial_statement_eu_account_assoc_code("4604%", "E.B52", False) + fse.financial_statement_eu_account_assoc_code("4605%", "E.B52", False) + fse.financial_statement_eu_account_assoc_code("4606%", "E.B52", False) + fse.financial_statement_eu_account_assoc_code("4607%", "E.B52", False) + fse.financial_statement_eu_account_assoc_code("4608%", "E.B52", False) + fse.financial_statement_eu_account_assoc_code("4701%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4702%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4706%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4814%", "E.B7", False) + fse.financial_statement_eu_account_assoc_code("4821%", "E.B7", False) + fse.financial_statement_eu_account_assoc_code("4823%", "E.B8", False) + fse.financial_statement_eu_account_assoc_code("4901%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4903%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4905%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4910%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4920%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4930%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("4940%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("5110%", "E.C244", False) + fse.financial_statement_eu_account_assoc_code("5115%", "E.C244", False) + fse.financial_statement_eu_account_assoc_code("5116%", "E.C215", False) + fse.financial_statement_eu_account_assoc_code("5140%", "E.C23", False) + fse.financial_statement_eu_account_assoc_code("5201%", "E.C35", False) + fse.financial_statement_eu_account_assoc_code("5202%", "E.C35", False) + fse.financial_statement_eu_account_assoc_code("5203%", "E.C35", False) + fse.financial_statement_eu_account_assoc_code("5210%", "E.C35", False) + fse.financial_statement_eu_account_assoc_code("5240%", "E.C35", False) + fse.financial_statement_eu_account_assoc_code("7101%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("7102%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("7103%", "E.A511", False) + fse.financial_statement_eu_account_assoc_code("7201%", "E.D23", False) + fse.financial_statement_eu_account_assoc_code("7202%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("7203%", "E.B9", False) + fse.financial_statement_eu_account_assoc_code("7204%", "E.F5", False) + fse.financial_statement_eu_account_assoc_code("8101%", "E_F1", False) diff --git a/l10n_it_financial_statement_eu/migrations/16.0.1.0.0/pre-migrate.py b/l10n_it_financial_statement_eu/migrations/16.0.1.0.0/pre-migrate.py new file mode 100644 index 000000000000..bf91ed940bc7 --- /dev/null +++ b/l10n_it_financial_statement_eu/migrations/16.0.1.0.0/pre-migrate.py @@ -0,0 +1,124 @@ +# Copyright 2023 MKT SRL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + +NEW_MODULE_NAME = "l10n_it_financial_statement_eu" +OLD_MODULE_NAME = "l10n_it_account_balance_eu" +RENAMED_MODELS = [ + ( + "account.balance.eu", + "financial.statement.eu", + ), + ( + "account.balance.eu.log", + "financial.statement.eu.log", + ), + ( + "account.balance.eu.wizard", + "financial.statement.eu.wizard", + ), + ( + "report.l10n_it_account_balance_eu.balance_eu_xlsx_report", + "report.l10n_it_financial_statement_eu.fseu_xlsx_report", + ), + ( + "report.l10n_it_account_balance_eu.balance_eu_xbrl_report", + "report.l10n_it_financial_statement_eu.fseu_xbrl_report", + ), + ( + "report.l10n_it_account_balance_eu.balance_eu_html_report", + "report.l10n_it_financial_statement_eu.fseu_html_report", + ), +] + +RENAMED_FIELDS = [ + [ + ( + "account.account", + "account_balance_eu_debit_id", + ), + ( + "account.account", + "financial_statement_eu_debit_id", + ), + ], + [ + ( + "account.account", + "account_balance_eu_credit_id", + ), + ( + "account.account", + "financial_statement_eu_credit_id", + ), + ], + [ + ( + "financial.statement.eu.log", + "balance_id", + ), + ( + "financial.statement.eu.log", + "financial_statement_id", + ), + ], +] +RENAMED_XMLIDS = [ + ( + "view_account_form_balance_ue", + "view_form_account_financial_statement_eu", + ), + ( + "template_account_balance_report", + "fseu_html_report", + ), +] + + +@openupgrade.migrate() +def migrate(env, version): + old_view = env["ir.ui.view"].search( + [ + ("name", "=", "view.account.form.balance.ue"), + ("model", "=", "account.account"), + ] + ) + if old_view: + old_view.sudo().unlink() + + openupgrade.rename_models( + env.cr, + RENAMED_MODELS, + ) + field_spec = [] + for renamed_field in RENAMED_FIELDS: + (old_model, old_field), (new_model, new_field) = renamed_field + field_spec.append( + ( + old_model, + old_model.replace(".", "_"), + old_field, + new_field, + ) + ) + openupgrade.rename_fields( + env, + field_spec, + ) + + openupgrade.rename_xmlids( + env.cr, + [ + ( + ".".join((OLD_MODULE_NAME, old_xml_id)), + ".".join((NEW_MODULE_NAME, new_xml_id)), + ) + for old_xml_id, new_xml_id in RENAMED_XMLIDS + ], + ) + # without forcing rename_tables this error occurs: + # Keep unexpected index account_account_deprecated_index on table account_account + openupgrade.rename_tables( + env.cr, [("account_balance_eu", "financial_statement_eu")] + ) diff --git a/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js b/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js index 680165fb0b4a..6e4fb66f7453 100644 --- a/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js +++ b/l10n_it_financial_statement_eu/static/src/js/client_action.esm.js @@ -1,7 +1,6 @@ /** @odoo-module **/ import {ReportAction} from "@web/webclient/actions/reports/report_action"; import {patch} from "web.utils"; -// Import { patch } from '@web/core/utils/patch'; import {useEnrichWithActionLinks} from "./report.esm"; const MODULE_NAME = "l10n_it_financial_statement_eu"; diff --git a/l10n_it_financial_statement_eu/static/src/xml/report.xml b/l10n_it_financial_statement_eu/static/src/xml/report.xml index 416caa8d247e..51f70b410260 100644 --- a/l10n_it_financial_statement_eu/static/src/xml/report.xml +++ b/l10n_it_financial_statement_eu/static/src/xml/report.xml @@ -7,18 +7,6 @@ owl="1" > - - - - - - - - - - - -