Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][OU-ADD] purchase_stock: Migration to 17.0 #4644

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion docsource/modules160-170.rst
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ Module coverage 16.0 -> 17.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_requisition_stock | |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_stock | | |
| purchase_stock | Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| rating | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


def _purchase_stock_convert_created_purchase_line_id_m2o_to_m2m(env):
"""
Convert m2o to m2m in 'purchase.stock'
"""
openupgrade.m2o_to_x2m(
env.cr,
env["stock.move"],
"stock_move",
"created_purchase_line_ids",
"created_purchase_line_id",
)


@openupgrade.migrate()
def migrate(env, version):
_purchase_stock_convert_created_purchase_line_id_m2o_to_m2m(env)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---Models in module 'purchase_stock'---
---Fields in module 'purchase_stock'---
purchase_stock / product.category / property_account_creditor_price_difference_categ (many2one): previously in module purchase_price_diff
purchase_stock / product.product / property_account_creditor_price_difference (many2one): previously in module purchase_price_diff
purchase_stock / product.template / property_account_creditor_price_difference (many2one): previously in module purchase_price_diff
purchase_stock / purchase.order.line / move_dest_ids (one2many) : table is now 'stock_move_created_purchase_line_rel' ('False')
purchase_stock / purchase.order.line / move_dest_ids (one2many) : type is now 'many2many' ('one2many')
# NOTHING TO DO: handle by ORM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# NOTHING TO DO: handle by ORM
# NOTHING TO DO: handled by openupgradelib

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right.


purchase_stock / stock.move / created_purchase_line_id (many2one): DEL relation: purchase.order.line
purchase_stock / stock.move / created_purchase_line_ids (many2many): NEW relation: purchase.order.line
# DONE post-migration: convert from m2o to m2m

---XML records in module 'purchase_stock'---
NEW ir.ui.view: purchase_stock.product_template_form_view
NEW ir.ui.view: purchase_stock.product_view_kanban_catalog_purchase_only
NEW ir.ui.view: purchase_stock.stock_reorder_report_search_inherited_purchase_stock
NEW ir.ui.view: purchase_stock.view_category_property_form
NEW ir.ui.view: purchase_stock.view_product_replenish_form_inherit_stock
# NOTHING TO DO: new feature

DEL ir.ui.view: purchase_stock.purchase_report_product_product_replenishment
# NOTHING TO DO
Loading