sajaniemi_variable_dataset_large / pool /shard005 /Python /0044770_pre-migration.py
Pendigard's picture
Upload folder using huggingface_hub (part 65)
fdd9b49 verified
Raw History Blame Contribute Delete
529 Bytes
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,
)