Skip to content
Snippets Groups Projects
Commit 119f04d3 authored by Arnold Moyaux's avatar Arnold Moyaux Committed by William Henrotin
Browse files

[FIX] mrp: merge moves in pick before manufacturing


Use case:
It happens that a product is consumed in different operations.
So it needs two distinct BoM lines. Since commit [1] the stock.move
in pbm are not merged. However [1] was design for kit.
In our case we would like to have only one stock.move for all the
quantities.

The fix is not perfect because it won't work if we confirm at the
same time a move with a kit and without it. But at least it will let
people using MO without kit has the correct behavior

+ remove a duplicate of the function

[1] commit 741d2fe9

closes odoo/odoo#125733

X-original-commit: f7414901
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 2484cb13
No related branches found
No related tags found
No related merge requests found
......@@ -461,7 +461,11 @@ class StockMove(models.Model):
@api.model
def _prepare_merge_moves_distinct_fields(self):
return super()._prepare_merge_moves_distinct_fields() + ['created_production_id', 'cost_share', 'bom_line_id']
res = super()._prepare_merge_moves_distinct_fields()
res += ['created_production_id', 'cost_share']
if self.bom_line_id and ("phantom" in self.bom_line_id.bom_id.mapped('type')):
res.append('bom_line_id')
return res
@api.model
def _prepare_merge_negative_moves_excluded_distinct_fields(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment