diff --git a/fiscal_company_account/hooks.py b/fiscal_company_account/hooks.py index 757d0a5..d159009 100644 --- a/fiscal_company_account/hooks.py +++ b/fiscal_company_account/hooks.py @@ -11,6 +11,7 @@ "account.journal_comp_rule", # account.journal "account.account_root_comp_rule", # account.root "account.tax_comp_rule", # account.tax + "account.tax_rep_comp_rule", # account.tax.repartition.line ] @@ -26,4 +27,6 @@ def _toggle_standard_rules(cr, enabled): env = api.Environment(cr, SUPERUSER_ID, {}) for xml_id in _CORE_RULES: rule = env.ref(xml_id) - rule.active = enabled + if rule.active != enabled: + _logger.info(f"Default rule {xml_id}. Active set to {enabled}.") + rule.active = enabled diff --git a/fiscal_company_account/migrations/16.0.2.5.0/post-migration.py b/fiscal_company_account/migrations/16.0.2.5.0/post-migration.py new file mode 100644 index 0000000..b1bdb07 --- /dev/null +++ b/fiscal_company_account/migrations/16.0.2.5.0/post-migration.py @@ -0,0 +1,9 @@ +# Copyright 2024 ForgeFlow S.L. (http://www.forgeflow.com) +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +# pylint: disable=W8150 +from odoo.addons.fiscal_company_account import hooks + + +def migrate(cr, version): + hooks._toggle_standard_rules(cr, False) diff --git a/fiscal_company_account/security/ir_rule.xml b/fiscal_company_account/security/ir_rule.xml index 619ff80..8eb2175 100644 --- a/fiscal_company_account/security/ir_rule.xml +++ b/fiscal_company_account/security/ir_rule.xml @@ -41,6 +41,18 @@ Copyright (C) 2013-Today GRAP (http://www.grap.coop) + + + + + + account.tax.repartition.line (fiscal_company_account) + + + [('company_id', 'in', user._include_fiscal_company_ids(company_ids))] + + +