diff options
| author | yhu-odoo <yhu@odoo.com> | 2021-03-02 12:19:30 +0000 |
|---|---|---|
| committer | yhu-odoo <yhu@odoo.com> | 2021-03-02 13:22:15 +0000 |
| commit | 60d799059d60befc976fd0fe5e2c0afec5d3f83b (patch) | |
| tree | 069acb6c2c00e729ca98e32aa0bde2a4e6e2bcee /addons/mrp_subcontracting/models | |
| parent | 9c8286b8a6fb376aa21b833cb35da044d2eb0e23 (diff) | |
[FIX] mrp_subcontracting: wrong subcontracted productions
Previously, when we find out subcontracted productions of moves, we get
all production_id from the origin moves of the moves. When user use
multple steps manufacturing, moves may also have their move_orig_ids.
In this case, we will consider its production_id as subcontracted
production.
To fix, we filered the moves, consider only move that is_subcontract is
true.
closes odoo/odoo#67066
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Diffstat (limited to 'addons/mrp_subcontracting/models')
| -rw-r--r-- | addons/mrp_subcontracting/models/stock_picking.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mrp_subcontracting/models/stock_picking.py b/addons/mrp_subcontracting/models/stock_picking.py index 23949e6cac9..4649a0ef673 100644 --- a/addons/mrp_subcontracting/models/stock_picking.py +++ b/addons/mrp_subcontracting/models/stock_picking.py @@ -105,7 +105,7 @@ class StockPicking(models.Model): return self.picking_type_id.code == 'incoming' and any(m.is_subcontract for m in self.move_lines) def _get_subcontracted_productions(self): - return self.move_lines.move_orig_ids.production_id + return self.move_lines.filtered(lambda move: move.is_subcontract).move_orig_ids.production_id def _get_warehouse(self, subcontract_move): return subcontract_move.warehouse_id or self.picking_type_id.warehouse_id |
