Skip to content

Commit

Permalink
[FIX] loyalty_multi_gift: Transfer m2m data to new table
Browse files Browse the repository at this point in the history
By changing the name of the template, the relationship table of the
field "reward_product_ids" with the template "loyalty.reward.product_line" formerly "coupon.reward.product_line" changes so the data from the old table has to be moved to the new one.

TT44321
  • Loading branch information
pilarvargas-tecnativa committed Jul 15, 2024
1 parent a5b72cb commit 97035d1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions loyalty_multi_gift/migrations/16.0.1.0.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Tecnativa - Pilar Vargas
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.logged_query(
env.cr,
"""
INSERT INTO loyalty_reward_product_line_product_product_rel
(loyalty_reward_product_line_id, product_product_id)
SELECT coupon_reward_product_line_id, product_product_id
FROM coupon_reward_product_line_product_product_rel
""",
)

0 comments on commit 97035d1

Please sign in to comment.