diff --git a/docsource/modules160-170.rst b/docsource/modules160-170.rst index f1d925eea135..89636a383623 100644 --- a/docsource/modules160-170.rst +++ b/docsource/modules160-170.rst @@ -840,7 +840,7 @@ Module coverage 16.0 -> 17.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | stock | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| stock_account | | | +| stock_account | Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | |new| stock_delivery | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/stock_account/17.0.1.1/pre-migration.py b/openupgrade_scripts/scripts/stock_account/17.0.1.1/pre-migration.py new file mode 100644 index 000000000000..790a67adf2f1 --- /dev/null +++ b/openupgrade_scripts/scripts/stock_account/17.0.1.1/pre-migration.py @@ -0,0 +1,30 @@ +# Copyright 2023 Trần Trường Sơn +# Copyright 2023 Rémy Taymans +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + +_new_fields = [ + ( + "categ_id", # Field name + ) +] + + +def _fill_stock_valuation_layer_categ_id(env): + """Field `categ_id` on stock.valuation.layer is now a stored field.""" + openupgrade.logged_query( + env.cr, + """ + UPDATE stock_valuation_layer stl + SET categ_id = p.categ_id + FROM product_product p + WHERE stl.product_id = p.id; + """, + ) + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.add_fields(env, _new_fields) + _fill_stock_valuation_layer_categ_id(env) diff --git a/openupgrade_scripts/scripts/stock_account/17.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/stock_account/17.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..2f1acbab01dc --- /dev/null +++ b/openupgrade_scripts/scripts/stock_account/17.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,31 @@ +---Models in module 'stock_account'--- +---Fields in module 'stock_account'--- +stock_account / account.move.line / cogs_origin_id (many2one) : NEW relation: account.move.line +# NOTHING TO DO: new feature + +stock_account / stock.move / analytic_account_line_id (many2one): DEL relation: account.analytic.line +stock_account / stock.move / analytic_account_line_ids (many2many): NEW relation: account.analytic.line +# NOTHING TO DO + +stock_account / stock.valuation.layer / categ_id (many2one) : is now stored +# DONE: pre-migration: Add new column & set value for it + +---XML records in module 'stock_account'--- +NEW ir.actions.act_window: stock_account.inventory_aging_action +NEW ir.filters: stock_account.filter_invoice_inventory_valuation +# NOTHING TO DO: new feature + +DEL ir.property: stock_account.property_stock_account_input_categ_id (noupdate) +DEL ir.property: stock_account.property_stock_account_output_categ_id (noupdate) +# NOTHING TO DO: New noupdate="1" records + +NEW ir.ui.menu: stock_account.menu_inventory_aging +NEW ir.ui.view: stock_account.stock_valuation_layer_graph +NEW ir.ui.view: stock_account.stock_valuation_layer_valuation_at_date_tree_inherited +# NOTHING TO DO: new feature + +DEL ir.ui.view: stock_account.stock_account_report_product_product_replenishment +# NOTHING TO DO + +NEW res.groups: stock_account.group_stock_accounting_automatic (noupdate) +# NOTHING TO DO: New noupdate="1" records