[FIX] stock: prevent crash on availability
opw-2157386 closes odoo/odoo#42081 X-original-commit: bd6631f0dff3433d70d4279c336f132d4c46441c Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -354,7 +354,7 @@ class StockMove(models.Model):
|
||||
if move.state == 'done':
|
||||
move.availability = move.product_qty
|
||||
else:
|
||||
total_availability = self.env['stock.quant']._get_available_quantity(move.product_id, move.location_id)
|
||||
total_availability = self.env['stock.quant']._get_available_quantity(move.product_id, move.location_id) if move.product_id else 0.0
|
||||
move.availability = min(move.product_qty, total_availability)
|
||||
|
||||
def _compute_string_qty_information(self):
|
||||
|
||||
Reference in New Issue
Block a user