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

[14.0][MIG]repair: add mig script #70

Merged
merged 2 commits into from
Jan 20, 2022
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/modules130-140.rst
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|rating | Done |
+--------------------------------------------+-------------------------------------------------+
|repair | |
|repair | Done |
+--------------------------------------------+-------------------------------------------------+
|resource | Nothing to do |
+--------------------------------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@
<record id="seq_repair" model="ir.sequence">
<field name="company_id" eval="False"/>
</record>
<!-- manually added: -->
<record id="repair_order_rule" model="ir.rule">
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
<field name="name">repair order multi-company</field>
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---Models in module 'repair'---
obsolete model repair.cancel [transient]
# NOTHING TO DO

---Fields in module 'repair'---
repair / repair.fee / company_id (many2one) : NEW relation: res.company, isrelated: related, stored
repair / repair.line / company_id (many2one) : NEW relation: res.company, isrelated: related, stored
repair / repair.line / repair_id (many2one) : now required
repair / repair.order / company_id (many2one) : now required, req_default: function
# NOTHING TO DO

---XML records in module 'repair'---
DEL ir.actions.act_window: repair.action_cancel_repair
NEW ir.model.access: repair.access_repair_order_make_invoice
NEW ir.model.access: repair.access_stock_warn_insufficient_qty_repair
# NOTHING TO DO

NEW ir.rule: repair.repair_order_rule (noupdate)
DEL ir.rule: repair.repair_rule (noupdate)
# DONE: pre-migration: renamed xmlid

NEW ir.rule: repair.repair_fee_rule (noupdate)
NEW ir.rule: repair.repair_line_rule (noupdate)
DEL ir.ui.view: repair.view_cancel_repair
# NOTHING TO DO
13 changes: 13 additions & 0 deletions openupgrade_scripts/scripts/repair/14.0.1.0/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2021 Open Source Integrators
# Copyright 2021 ForgeFlow S.L. <https://www.forgeflow.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
# Load noupdate changes
openupgrade.load_data(env.cr, "repair", "14.0.1.0/noupdate_changes.xml")
openupgrade.delete_record_translations(
env.cr, "repair", ["mail_template_repair_quotation"]
)
12 changes: 12 additions & 0 deletions openupgrade_scripts/scripts/repair/14.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2021 ForgeFlow S.L. <https://www.forgeflow.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade

_xmlid_renames = [
("repair.repair_rule", "repair.repair_order_rule"),
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_xmlids(env.cr, _xmlid_renames)