Skip to content

Commit

Permalink
[FIX] loyalty_multi_gift: Rename m2m field table
Browse files Browse the repository at this point in the history
When renaming the model, the relationship table of the
field "reward_product_ids" to the model "loyalty.reward.product_line"
formerly "coupon.reward.product_line" must also be renamed.

TT44321
  • Loading branch information
pilarvargas-tecnativa committed Jul 15, 2024
1 parent a5b72cb commit 125f7cd
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 125f7cd

Please sign in to comment.