[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user