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

[MIG][15.0]purchase_requisition_stock: add mig script v15 #3321

Merged
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
2 changes: 1 addition & 1 deletion docsource/modules140-150.rst
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ Module coverage 14.0 -> 15.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_requisition | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| purchase_requisition_stock | | |
| purchase_requisition_stock |Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| |new| purchase_requisition_stock_dropshipping | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.logged_query(
env.cr,
"""
WITH subquery as (
SELECT op.name as origin, p.id as pid
FROM stock_warehouse_orderpoint AS op
LEFT JOIN procurement_group AS p ON op.group_id = p.id
)
UPDATE purchase_requisition as requisition
SET procurement_group_id = subquery.pid
FROM subquery
WHERE requisition.origin = subquery.origin;
""",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---Models in module 'purchase_requisition_stock'---
---Fields in module 'purchase_requisition_stock'---
purchase_requisition_stock / purchase.requisition / procurement_group_id (many2one): NEW relation: procurement.group
# DONE: post-migration: fill data from stock.warehouse.orderpoint

---XML records in module 'purchase_requisition_stock'---