-
-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] mrp_account: Migration to 15.0
- Loading branch information
Ernesto Tejeda
committed
Mar 23, 2023
1 parent
341ccd4
commit 7ac9ea4
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
openupgrade_scripts/scripts/mrp_account/15.0.1.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2023 Tecnativa - Ernesto Tejeda | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
def pre_create_mrp_production_analytic_account_id(env): | ||
""" Pre-create the column for avoiding computation on module upgrade """ | ||
if openupgrade.column_exists(env.cr, "mrp_production", "analytic_account_id"): | ||
return | ||
openupgrade.add_fields( | ||
env, | ||
[ | ||
( | ||
"analytic_account_id", | ||
"mrp.production", | ||
"mrp_production", | ||
"many2one", | ||
False, | ||
"mrp_account", | ||
) | ||
], | ||
) | ||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
pre_create_mrp_production_analytic_account_id(env) |
21 changes: 21 additions & 0 deletions
21
openupgrade_scripts/scripts/mrp_account/15.0.1.0/upgrade_analysis_work.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
---Models in module 'mrp_account'--- | ||
---Fields in module 'mrp_account'--- | ||
mrp_account / account.analytic.account / bom_ids (one2many) : NEW relation: mrp.bom | ||
mrp_account / account.analytic.account / production_ids (one2many) : NEW relation: mrp.production | ||
mrp_account / account.analytic.account / workcenter_ids (one2many) : NEW relation: mrp.workcenter | ||
mrp_account / account.analytic.line / category (False) : NEW selection_keys: ['invoice', 'manufacturing_order', 'other', 'vendor_bill'], mode: modify | ||
mrp_account / mrp.bom / analytic_account_id (many2one): NEW relation: account.analytic.account | ||
# NOTHING TO DO: new feature | ||
|
||
mrp_account / mrp.production / analytic_account_id (many2one): NEW relation: account.analytic.account, hasdefault: compute | ||
# DONE: pre-migration: pre-create column 'analytic_account_id' for avoiding computation on module upgrade | ||
|
||
mrp_account / mrp.workorder / mo_analytic_account_line_id (many2one): NEW relation: account.analytic.line | ||
mrp_account / mrp.workorder / wc_analytic_account_line_id (many2one): NEW relation: account.analytic.line | ||
# NOTHING TO DO: new feature | ||
|
||
---XML records in module 'mrp_account'--- | ||
NEW ir.ui.view: mrp_account.account_analytic_account_view_form_mrp | ||
NEW ir.ui.view: mrp_account.mrp_bom_form_view_inherited | ||
NEW ir.ui.view: mrp_account.view_production_graph_inherit_mrp_account | ||
# NOTHING TO DO: new records |