TIP: You can type at any time to perform a new search.
Link Purchase Order Line to Subcontract Productions
mrp_subcontracting_purchase_link · OCA/manufacture
Security findings
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. No target version is selected: apply version-specific advice only when migrating to that version or later.
- Repository
- OCA/manufacture · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Manufacturing
- Folder size
- 0.05 MB
- License
- LGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/manufacture
- Last tracking update
- 2026-08-07 09:06:24
- Authors
- Odoo Community Association (OCA), Quartile Limited, ForgeFlow
- Maintainers
- Odoo Community Association (OCA), Quartile Limited, ForgeFlow
- Committers
- OCA-git-bot, oca-ci, JasminSForgeFlow
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- 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.
Code Analysis
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 (3)
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.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…