Skip to content
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
11 changes: 7 additions & 4 deletions addons/product/migrations/10.0.1.2/openupgrade_analysis_work.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,18 +13,21 @@ 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

product / res.country.group / pricelist_ids (many2many) : NEW relation: product.pricelist
# 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
Expand Down
28 changes: 28 additions & 0 deletions addons/product/migrations/10.0.1.2/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# © 2017 Therp BV <http://therp.nl>
# 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)
2 changes: 1 addition & 1 deletion odoo/openupgrade/doc/source/modules90-100.rst
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ missing in the new release are marked with |del|.
+-----------------------------------+-----------------------------------+
|procurement_jit | |
+-----------------------------------+-----------------------------------+
|product | |
|product | Done |
+-----------------------------------+-----------------------------------+
|product_email_template | Nothing to do |
+-----------------------------------+-----------------------------------+
Expand Down