Skip to content

Commit

Permalink
Merge PR #75 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
github-grap-bot committed Jan 24, 2025
2 parents aea6ae9 + 018d014 commit 2fbff2a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fiscal_company_account/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]


Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 12 additions & 0 deletions fiscal_company_account/security/ir_rule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ Copyright (C) 2013-Today GRAP (http://www.grap.coop)
</field>
</record>


<!-- account.tax.repartition.line -->
<!-- See the tax repartition lines of the fiscal mother company -->
<!-- Odoo DEFAULT: [('company_id', 'in', company_ids)] -->
<record id="rule_account_tax_repartition_line" model="ir.rule">
<field name="name">account.tax.repartition.line (fiscal_company_account)</field>
<field name="model_id" ref="account.model_account_tax_repartition_line"/>
<field name="domain_force">
[('company_id', 'in', user._include_fiscal_company_ids(company_ids))]
</field>
</record>

<!-- account.journal -->
<!-- See the journals of the fiscal mother company -->
<!-- Odoo DEFAULT: [('company_id', 'in', company_ids)] -->
Expand Down

0 comments on commit 2fbff2a

Please sign in to comment.