From e0f0b86a9b2a678b6d43fcc9e1d78bb561f93b6e Mon Sep 17 00:00:00 2001 From: JF Aubert Date: Fri, 20 Aug 2021 10:08:00 +0000 Subject: [PATCH] [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 --- addons/stock/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index bd1f59a85ba..47ed688fd62 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -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')