summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2018-10-10 11:27:54 +0000
committerGoffin Simon <sig@odoo.com>2018-10-10 11:34:37 +0000
commitd211ea5f7c93f91c4d90748894529f063d490bcb (patch)
tree5c1ee9a7fa8cf154d1bcfa6b16714d3adf0517a3 /addons
parent26d67991c2ff5de77ce0d69284d7aaa97c9955f5 (diff)
[FIX] purchase_mrp: Received Quantity in Purchase Order remains '0'
Steps to reproduce the bug: - Create Product P: with BOM type - Kit and BOM components > Set - Invoicing: on delivered quantity - Create PO with P and confirm - shipment 1 will be generated - Cancel the PO - shipment 1 - will also get canceled - Reset the canceled PO to quotation and confirm it - new shipment 2 will be generated - Validate the shipment and receive product KIT Bug: Check PO - 'Received Qty' was not updated Inspired from: https://github.com/odoo/odoo/commit/c2dfdc3081764a492a94024f1fb57e15636b04c9 opw:1889303 closes odoo/odoo#27622
Diffstat (limited to 'addons')
-rw-r--r--addons/purchase_mrp/models/purchase_mrp.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/purchase_mrp/models/purchase_mrp.py b/addons/purchase_mrp/models/purchase_mrp.py
index ded251bbdff..c24d50eb776 100644
--- a/addons/purchase_mrp/models/purchase_mrp.py
+++ b/addons/purchase_mrp/models/purchase_mrp.py
@@ -23,7 +23,8 @@ class PurchaseOrderLine(models.Model):
# In the case of a kit, we need to check if all components are shipped. Since the BOM might
# have changed, we don't compute the quantities but verify the move state.
if bom:
- bom_delivered = all([move.state == 'done' for move in self.move_ids])
+ moves = self.move_ids.filtered(lambda m: m.picking_id and m.picking_id.state != 'cancel')
+ bom_delivered = all([move.state == 'done' for move in moves])
if bom_delivered:
return self.product_qty
else: