Skip to content
Snippets Groups Projects
Commit 3f16ed9e authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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
parent 800a4b67
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment