Link Purchase Order Line to Subcontract Productions
mrp_subcontracting_purchase_link · OCA/manufacture
Health
80/100
good
-
Security25/25No findings
-
Activity25/25Last human commit 1 month ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 8 Odoo series since 12.0
Heuristic over the facts below, not an audit · How it's computed
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
LGPL-3
No conflicts with its dependencies
Folder size
0.05 MB
Module directory on disk
Code analysis
1 migration note
4 models
2 views
0 HTTP endpoints
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE mrp_production SET purchase_line_id = Q.purchase_line_id, purchase_order_id = Q.purchase_id FROM ( SELECT po_sm.purchase_line_id, mo_sm.production_id, po.id as purchase_id FROM stock_move as po_sm INNER JOIN stock_move_move_rel as rel ON rel.move_dest_id = po_sm.id INNER JOIN stock_move as mo_sm ON mo_sm.id = rel.move_orig_id INNER JOIN purchase_order_line as pol ON pol.id = po_sm.purchase_line_id INNER JOIN purchase_order as po ON po.id = pol.order_id where po_sm.is_subcontract = true AND po_sm.purchase_line_id is not null AND mo_sm.production_id is not null ) AS Q WHERE mrp_production.id = Q.production_id` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
This module does the following:
- Extends _prepare_subcontract_mo_vals() and adds the purchase order line reference to the subcontracted manufacturing orders.
- Adds an action button in the purchase order form view to open related subcontracted manufacturing orders.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 2
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
mrp_production_form_view |
mrp.production.form | mrp.production | form | Inherits mrp.mrp_production_form_view |
purchase_order_form |
purchase.order.form | purchase.order | form | Inherits purchase.purchase_order_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 4
New fields (2)
-
purchase_line_idMany2one → purchase.order.linereadonly=True args: 'purchase.order.line', 'Subcontract Purchase Order Line' -
purchase_order_idMany2one → purchase.orderreadonly=Truerelated='purchase_line_id.order_id'store=True args: 'purchase.order', 'Subcontract Purchase Order'
No public methods.
New fields (2)
-
subcontract_production_countIntegercompute='_compute_subcontract_production_count' -
subcontract_production_idsOne2many → mrp.productionreadonly=True args: 'mrp.production', 'purchase_order_id', 'Subcontract Production Orders'
-
action_view_mrp(self)
New fields (0)
No new fields.
Public methods (0)No public methods.
New fields (0)
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…