Skip to content

Commit

Permalink
Merge pull request #3754 from Tecnativa/15.0-ou_add-coupon
Browse files Browse the repository at this point in the history
[15.0][OU-ADD] coupon: Migration scripts
  • Loading branch information
pedrobaeza authored Mar 11, 2023
2 parents 2adbcbb + 0928fba commit 420b123
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docsource/modules140-150.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Module coverage 14.0 -> 15.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| contacts |Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| coupon | | |
| coupon | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| crm | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
11 changes: 11 additions & 0 deletions openupgrade_scripts/scripts/coupon/15.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_xmlids(
env.cr,
[("coupon.mail_template_sale_coupon", "sale_coupon.mail_template_sale_coupon")],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---Models in module 'coupon'---
---Fields in module 'coupon'---
coupon / coupon.program / company_id (many2one) : now required
# NOTHING TO DO: It was enforced in v14 through the view, so only incorrect code can insert programs without company_id, and the fix belongs to the creators of such code

---XML records in module 'coupon'---
DEL mail.template: coupon.mail_template_sale_coupon [renamed to sale_coupon module] (noupdate)
# DONE: pre-migration: XML-ID renamed

0 comments on commit 420b123

Please sign in to comment.