diff --git a/addons/product/migrations/10.0.1.2/openupgrade_analysis_work.txt b/addons/product/migrations/10.0.1.2/openupgrade_analysis_work.txt index e3bc0f081872..eb7b6280f932 100644 --- a/addons/product/migrations/10.0.1.2/openupgrade_analysis_work.txt +++ b/addons/product/migrations/10.0.1.2/openupgrade_analysis_work.txt @@ -3,7 +3,7 @@ product / product.attribute / create_variant (boolean) : NEW # NOTHING TO DO product / product.category / sequence (integer) : DEL -# NOTHING TO DO +# Done: Preserved field in pre-migration product / product.pricelist / country_group_ids (many2many) : NEW relation: res.country.group product / product.pricelist / sequence (integer) : NEW @@ -13,10 +13,13 @@ product / product.product / item_ids (many2many) : not a product / product.product / item_ids (many2many) : type is now 'one2many' ('many2many') # NOTHING TO DO +product / product.template / state (selection) : DEL selection_keys: ['draft', 'end', 'obsolete', 'sellable'] +product / product.template / product_manager (many2one) : DEL relation: res.users +# Done: Preserved field in pre-migration, just in case that someone uses them + in other modules + product / product.template / default_code (char) : now a function product / product.template / pricelist_id (many2one) : not a function anymore -product / product.template / product_manager (many2one) : DEL relation: res.users -product / product.template / state (selection) : DEL selection_keys: ['draft', 'end', 'obsolete', 'sellable'] product / product.template / type (selection) : selection_keys is now '['consu', 'service']' ('function') # NOTHING TO DO @@ -24,7 +27,7 @@ product / res.country.group / pricelist_ids (many2many) : NEW re # NOTHING TO DO product / res.partner / property_product_pricelist (many2one): now a function -# TODO: Migrate from a property field to a real one +# NOTHING TO DO ---XML records in module 'product'--- NEW ir.actions.act_window: product.product_template_action_all diff --git a/addons/product/migrations/10.0.1.2/pre-migration.py b/addons/product/migrations/10.0.1.2/pre-migration.py new file mode 100644 index 000000000000..a97a8ffc03d7 --- /dev/null +++ b/addons/product/migrations/10.0.1.2/pre-migration.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# © 2017 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + +_column_renames = { + 'product_attribute_value_product_product_rel': [ + ('prod_id', 'product_product_id'), + ('att_id', 'product_attribute_value_id'), + ], + 'product_attribute_line_product_attribute_value_rel': [ + ('line_id', 'product_attribute_line_id'), + ('val_id', 'product_attribute_value_id'), + ], + # Preserve fields just in case that someone uses them in other modules. + 'product_category': [ + ('sequence', None), + ], + 'product_template': [ + ('state', None), + ('product_manager', None) + ], +} + + +@openupgrade.migrate(use_env=False) +def migrate(cr, version): + openupgrade.rename_columns(cr, _column_renames) diff --git a/odoo/openupgrade/doc/source/modules90-100.rst b/odoo/openupgrade/doc/source/modules90-100.rst index 4fcb477cac66..b6fdbf4e8405 100644 --- a/odoo/openupgrade/doc/source/modules90-100.rst +++ b/odoo/openupgrade/doc/source/modules90-100.rst @@ -387,7 +387,7 @@ missing in the new release are marked with |del|. +-----------------------------------+-----------------------------------+ |procurement_jit | | +-----------------------------------+-----------------------------------+ -|product | | +|product | Done | +-----------------------------------+-----------------------------------+ |product_email_template | Nothing to do | +-----------------------------------+-----------------------------------+