diff options
| author | Arnold Moyaux <arm@odoo.com> | 2019-07-31 13:56:41 +0000 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2019-08-19 15:03:59 +0000 |
| commit | 8c2b0a937f1fc552063c384392cee11baa742e19 (patch) | |
| tree | 4fd994b336ac8cca74e1641ceb26bea609b0505e /addons/mrp_subcontracting/models | |
| parent | 875d99812f8799ae21c850e06c2f35b200eaed75 (diff) | |
[IMP] mrp_subcontracting: partner on subcontract delivery
If the components have the route resupply subcontractor on order then the
delivery order triggered by the receipt do not have the origin nor the
subcontractor partner. This commit update the procurement group in
order to add those information and propagate it.
Diffstat (limited to 'addons/mrp_subcontracting/models')
| -rw-r--r-- | addons/mrp_subcontracting/models/stock_picking.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/mrp_subcontracting/models/stock_picking.py b/addons/mrp_subcontracting/models/stock_picking.py index c2502469b8c..012282ec98b 100644 --- a/addons/mrp_subcontracting/models/stock_picking.py +++ b/addons/mrp_subcontracting/models/stock_picking.py @@ -66,9 +66,14 @@ class StockPicking(models.Model): def _prepare_subcontract_mo_vals(self, subcontract_move, bom): subcontract_move.ensure_one() + group = self.env['procurement.group'].create({ + 'name': self.name, + 'partner_id': self.partner_id.id, + }) product = subcontract_move.product_id warehouse = subcontract_move.warehouse_id or self.picking_type_id.warehouse_id vals = { + 'procurement_group_id': group.id, 'product_id': product.id, 'product_uom_id': subcontract_move.product_uom.id, 'bom_id': bom.id, |
