mirror of
https://gitlab.com/flectra-community/partner-contact.git
synced 2024-12-23 12:51:46 +00:00
19 lines
587 B
Python
19 lines
587 B
Python
# Copyright 2021 Tecnativa - Víctor Martínez
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
|
|
from flectra import SUPERUSER_ID
|
|
from flectra.api import Environment
|
|
from flectra.tools import config
|
|
|
|
|
|
def post_init_hook(cr, pool):
|
|
"""
|
|
We need to activate the rule only if we are not in a test environment.
|
|
"""
|
|
if not config["test_enable"]:
|
|
env = Environment(cr, SUPERUSER_ID, {})
|
|
tier_partner = env.ref(
|
|
"partner_tier_validation.partner_tier_definition_company_only"
|
|
)
|
|
tier_partner.write({"active": True})
|