You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
578 B

  1. # Copyright 2021 Tecnativa - Víctor Martínez
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
  3. from odoo import SUPERUSER_ID
  4. from odoo.api import Environment
  5. from odoo.tools import config
  6. def post_init_hook(cr, pool):
  7. """
  8. We need to activate the rule only if we are not in a test environment.
  9. """
  10. if not config["test_enable"]:
  11. env = Environment(cr, SUPERUSER_ID, {})
  12. tier_partner = env.ref(
  13. "partner_tier_validation.partner_tier_definition_company_only"
  14. )
  15. tier_partner.write({"active": True})