-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by legalsylvain
- Loading branch information
Showing
4 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import logging | ||
|
||
from odoo import SUPERUSER_ID, api | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
_CORE_RULES = [ | ||
"base.res_company_rule_employee", # res.company | ||
] | ||
|
||
|
||
def post_init_hook(cr, registry): | ||
_toggle_standard_rules(cr, False) | ||
|
||
|
||
def uninstall_hook(cr, registry): | ||
_toggle_standard_rules(cr, True) | ||
|
||
|
||
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 |
11 changes: 11 additions & 0 deletions
11
fiscal_company_base/migrations/16.0.2.0.0/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (C) 2024-Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
|
||
# pylint: disable=W8150 | ||
from odoo.addons.fiscal_company_base import hooks | ||
|
||
|
||
def migrate(cr, version): | ||
hooks._toggle_standard_rules(cr, False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters