-
-
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.
Merge pull request #2843 from ForgeFlow/14.0-mig-sale
[14.0][MIG] sale
- Loading branch information
Showing
5 changed files
with
152 additions
and
6 deletions.
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
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
16 changes: 16 additions & 0 deletions
16
openupgrade_scripts/scripts/sale/14.0.1.1/post-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,16 @@ | ||
# 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 | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.load_data(env.cr, "sale", "14.0.1.1/noupdate_changes.xml") | ||
openupgrade.delete_record_translations( | ||
env.cr, | ||
"sale", | ||
[ | ||
"email_template_edi_sale", | ||
"mail_template_sale_confirmation", | ||
], | ||
) |
41 changes: 41 additions & 0 deletions
41
openupgrade_scripts/scripts/sale/14.0.1.1/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,41 @@ | ||
# 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 = [ | ||
( | ||
"sale.access_product_product_attribute_custom_value", | ||
"sale.access_product_product_attribute_custom_value_sale_manager", | ||
), | ||
("sale.account_move_see_all", "sale.account_invoice_rule_see_all"), | ||
("sale.account_move_personal_rule", "sale.account_invoice_rule_see_personal"), | ||
("sale.account_move_line_see_all", "sale.account_invoice_line_rule_see_all"), | ||
( | ||
"sale.account_move_line_personal_rule", | ||
"sale.account_invoice_line_rule_see_personal", | ||
), | ||
] | ||
|
||
|
||
def fast_fill_sale_order_currency_id(env): | ||
if not openupgrade.column_exists(env.cr, "sale_order", "currency_id"): | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
ALTER TABLE sale_order | ||
ADD COLUMN currency_id integer""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE sale_order so | ||
SET currency_id = pp.currency_id | ||
FROM product_pricelist pp | ||
WHERE so.pricelist_id = pp.id""", | ||
) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.rename_xmlids(env.cr, _xmlid_renames) | ||
fast_fill_sale_order_currency_id(env) |
75 changes: 75 additions & 0 deletions
75
openupgrade_scripts/scripts/sale/14.0.1.1/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,75 @@ | ||
---Models in module 'sale'--- | ||
model product.attribute.custom.value (moved to product) | ||
new model sale.order.cancel [transient] | ||
---Fields in module 'sale'--- | ||
sale / crm.team / invoiced (integer) : type is now 'float' ('integer') | ||
sale / crm.team / invoiced_target (integer) : type is now 'float' ('integer') | ||
sale / crm.team / quotations_amount (integer) : type is now 'float' ('integer') | ||
# NOTHING TO DO: Automatic conversion from integer to float is assured by PG | ||
|
||
sale / product.attribute / display_type (selection) : module is now 'product' ('sale') | ||
sale / product.attribute.custom.value / __last_update (datetime) : module is now 'product' ('sale') | ||
sale / product.attribute.custom.value / _order : module is now 'product' ('sale') | ||
sale / product.attribute.custom.value / custom_product_template_attribute_value_id (many2one): module is now 'product' ('sale') | ||
sale / product.attribute.custom.value / custom_value (char) : module is now 'product' ('sale') | ||
sale / product.attribute.custom.value / display_name (char) : module is now 'product' ('sale') | ||
sale / product.attribute.custom.value / name (char) : module is now 'product' ('sale') | ||
sale / product.attribute.value / display_type (selection) : module is now 'product' ('sale') | ||
sale / product.attribute.value / html_color (char) : module is now 'product' ('sale') | ||
sale / product.attribute.value / is_custom (boolean) : module is now 'product' ('sale') | ||
sale / product.template.attribute.value / display_type (selection) : module is now 'product' ('sale') | ||
sale / product.template.attribute.value / html_color (char) : module is now 'product' ('sale') | ||
sale / product.template.attribute.value / is_custom (boolean) : module is now 'product' ('sale') | ||
sale / sale.order / tag_ids (many2many) : previously in module sale_crm | ||
# NOTHING TO DO: handled by ORM | ||
|
||
sale / sale.order / currency_id (many2one) : is now stored | ||
# DONE: pre-migration: fast filled | ||
|
||
sale / sale.order / show_update_pricelist (boolean): NEW | ||
# NOTHING TO DO: new technical field | ||
|
||
---XML records in module 'sale'--- | ||
DEL ir.actions.act_window: sale.action_open_sale_onboarding_sample_quotation | ||
NEW ir.model.access: sale.access_account_invoice_send_salesman | ||
NEW ir.model.access: sale.access_payment_link_wizard_sale | ||
NEW ir.model.access: sale.access_sale_advance_payment_inv | ||
NEW ir.model.access: sale.access_sale_order_cancel | ||
NEW ir.model.access: sale.access_sale_order_line_readonly | ||
NEW ir.model.access: sale.access_sale_order_readonly | ||
NEW ir.model.access: sale.access_sale_payment_acquirer_onboarding_wizard | ||
DEL ir.model.access: sale.access_account_journal_sale_manager | ||
DEL ir.model.access: sale.access_ir_property_sales | ||
# NOTHING TO DO | ||
|
||
DEL ir.model.access: sale.access_product_product_attribute_custom_value | ||
NEW ir.model.access: sale.access_product_product_attribute_custom_value_sale_manager | ||
# DONE: pre-migration: renamed xmlid | ||
|
||
NEW ir.rule: sale.account_invoice_send_rule_see_all (noupdate) | ||
NEW ir.rule: sale.account_invoice_send_rule_see_personal (noupdate) | ||
NEW ir.rule: sale.sale_advance_payment_inv_rule (noupdate) | ||
NEW ir.rule: sale.sale_order_cancel_rule (noupdate) | ||
NEW ir.rule: sale.sale_payment_acquirer_onboarding_wizard_rule (noupdate) | ||
# NOTHING TO DO | ||
|
||
NEW ir.rule: sale.account_invoice_line_rule_see_personal (noupdate) | ||
NEW ir.rule: sale.account_invoice_line_rule_see_all (noupdate) | ||
NEW ir.rule: sale.account_invoice_rule_see_personal (noupdate) | ||
NEW ir.rule: sale.account_invoice_rule_see_all (noupdate) | ||
DEL ir.rule: sale.account_move_line_personal_rule (noupdate) | ||
DEL ir.rule: sale.account_move_line_see_all (noupdate) | ||
DEL ir.rule: sale.account_move_personal_rule (noupdate) | ||
DEL ir.rule: sale.account_move_see_all (noupdate) | ||
# DONE: pre-migration: renamed xmlids | ||
|
||
NEW ir.ui.menu: sale.menu_tag_config | ||
NEW ir.ui.view: sale.sale_order_cancel_view_form | ||
NEW ir.ui.view: sale.sale_order_line_view_kanban | ||
DEL ir.ui.view: sale.attribute_tree_view | ||
DEL ir.ui.view: sale.product_attribute_view_form | ||
DEL ir.ui.view: sale.product_template_attribute_line_form | ||
DEL ir.ui.view: sale.product_template_attribute_value_view_form_inherit | ||
DEL ir.ui.view: sale.product_template_attribute_value_view_tree_inherit | ||
DEL ir.ui.view: sale.sale_onboarding_sample_quotation_form | ||
# NOTHING TO DO |