Skip to content
Snippets Groups Projects
Commit 9659683d authored by JordiMForgeFlow's avatar JordiMForgeFlow Committed by William Henrotin
Browse files

[FIX] purchase_mrp: filter cancelled moves when evaluating kit


The current behaviour does not filter the cancelled moves when
evaluating if the product of the purchase order line is a kit.
This causes that, in cases where you have a cancelled wrong receipt
where the product was being received as a kit, if a new receipt is
created without receiving as a kit Odoo will always expect it as a kit.

After the fix, the cancelled moves will not be considered, as this is what
should be expected from cancelled operations.

closes odoo/odoo#107090

X-original-commit: 436299ee
Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 30f710e8
Branches
Tags
No related merge requests found
......@@ -49,7 +49,7 @@ class PurchaseOrderLine(models.Model):
def _compute_qty_received(self):
kit_lines = self.env['purchase.order.line']
lines_stock = self.filtered(lambda l: l.qty_received_method == 'stock_moves' and l.move_ids)
lines_stock = self.filtered(lambda l: l.qty_received_method == 'stock_moves' and l.move_ids and l.state != 'cancel')
product_by_company = defaultdict(OrderedSet)
for line in lines_stock:
product_by_company[line.company_id].add(line.product_id.id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment