Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][OU-ADD] coupon: Migration scripts #3754

Merged
merged 1 commit into from
Mar 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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