[FIX] sale_stock: qty calculation in procurement creation

When updating the qty on a confirmed sale order line,
we want the system to add new procurement qty
for the cancelled procurements. That way you can
leave the cancelled procurements for what they are.
This commit is contained in:
mehdi-ghezal
2018-06-12 11:44:50 +02:00
committed by Josse Colpaert
parent cb3e415a7c
commit 58e85bdec0
+1 -1
View File
@@ -594,7 +594,7 @@ class SaleOrderLine(models.Model):
if line.state != 'sale' or not line.product_id._need_procurement():
continue
qty = 0.0
for proc in line.procurement_ids:
for proc in line.procurement_ids.filtered(lambda r: r.state != 'cancel'):
qty += proc.product_qty
if float_compare(qty, line.product_uom_qty, precision_digits=precision) >= 0:
continue