[FIX] mrp: crash onchange

In a MO, change a product in "Consumed Materials" by clicking on "Search
more...". It crashes.

Clicking on "Search more..." triggers the onchange since it empties the
line. Since there is no product on the line anymore, it crashes.

opw-705644
This commit is contained in:
Nicolas Martinelli
2017-02-09 15:51:08 +01:00
parent 800a4b6728
commit 3f16ed9ef7
+1 -1
View File
@@ -87,7 +87,7 @@ class StockMove(models.Model):
# For consumables, state is available so availability = qty to do
if move.state == 'assigned':
move.quantity_available = move.product_uom_qty
else:
elif move.product_id.uom_id and move.product_uom:
move.quantity_available = move.product_id.uom_id._compute_quantity(move.reserved_availability, move.product_uom)
@api.multi