Skip to content
Browse files

[FIX] sale_mrp, sale_stock: No delivered_qty computed with partial de…


Steps to reproduce the bug:
- Create a consumable or storable final product A with invoicing policy
in "delivered quantity"
- Create two storable products B and C
- Create a BOM kit for A with 1 B and 1 C
- Create a SO with 5 qty of A and confirm it
- Deliver 3 B and 2 C and either on "No backorder" or "With backorder"


The delivered_qty on the SO line is of course not automatically updated
(as in this case, a right value is not computable) but the delivered_qty
was not updatable  manually and then it was possible to invoice the SO.

Co-authored-by: nim-odoo <>


  • Loading branch information...
simongoffin committed Apr 10, 2019
1 parent e1b1d3c commit 78141038dfbf65494c4812e816de0ced5e215f81
Showing with 10 additions and 0 deletions.
  1. +10 −0 addons/sale_mrp/models/
@@ -24,6 +24,16 @@ def _get_delivered_qty(self):
return 0.0
return super(SaleOrderLine, self)._get_delivered_qty()

def _compute_qty_delivered_updateable(self):
lines = self.env['sale.order.line']
for line in self:
bom = self.env['']._bom_find(product=line.product_id,
if bom and bom.type == 'phantom' and line.order_id.state == 'sale':
line.qty_delivered_updateable = True
lines |= line
super(SaleOrderLine, self - lines)._compute_qty_delivered_updateable()

def _get_bom_component_qty(self, bom):
bom_quantity = self.product_uom._compute_quantity(1, bom.product_uom_id)

0 comments on commit 7814103

Please sign in to comment.
You can’t perform that action at this time.