File size: 529 Bytes
fdd9b49 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | from openupgradelib import openupgrade
@openupgrade.migrate(use_env=True)
def migrate(env, version):
if not version:
return
# Associate already created toilets fund to new xml record
toilets_fund = env["product.template"].search(
[("default_code", "=", "toilet")]
)
if toilets_fund:
openupgrade.add_xmlid(
env.cr,
"sponsorship_switzerland",
"product_template_fund_toilets",
"product.template",
toilets_fund.id,
)
|