[FIX] stock: Fix forecast availability with UoM
virtual_available return the quantity in product base UoM while move product_uom_qty is the quantity with the UoM of the move For the forecast compare the quantity with the same UoM closes odoo/odoo#71732 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit is contained in:
@@ -897,7 +897,7 @@ class StockMove(models.Model):
|
||||
warehouse = self.location_dest_id.warehouse_id
|
||||
forecast_availability = self.product_id.with_context(warehouse=warehouse.id, to_date=self.date).virtual_available
|
||||
if self.state == 'draft':
|
||||
forecast_availability += self.product_uom_qty
|
||||
forecast_availability += self.product_qty
|
||||
return forecast_availability
|
||||
|
||||
@api.onchange('product_id', 'picking_type_id')
|
||||
|
||||
Reference in New Issue
Block a user