[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:
JF Aubert
2021-09-02 10:41:46 +00:00
committed by Arnold Moyaux
parent 972ce4e445
commit e0f0b86a9b
+1 -1
View File
@@ -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')