From 11a9c2d409411029c9a69b38fe22d6091f189847 Mon Sep 17 00:00:00 2001 From: Anael Closson Date: Tue, 13 May 2014 14:00:06 +0200 Subject: [PATCH] [FIX] sale_stock: new product uom is done twice in sale order line on change - opw 607150 [FIX] sale_stock: comparing stock and sale order line qty is always done with default uom rounding precision --- addons/sale_stock/sale_stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 50e0112fec2..6c1e4c58e6c 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -610,7 +610,7 @@ class sale_order_line(osv.osv): res_packing = self.product_packaging_change(cr, uid, ids, pricelist, product, qty, uom, partner_id, packaging, context=context) res['value'].update(res_packing.get('value', {})) warning_msgs = res_packing.get('warning') and res_packing['warning']['message'] or '' - compare_qty = float_compare(product_obj.virtual_available * uom2.factor, qty * product_obj.uom_id.factor, precision_rounding=product_obj.uom_id.rounding) + compare_qty = float_compare(product_obj.virtual_available, qty, precision_rounding=uom2.rounding) if (product_obj.type=='product') and int(compare_qty) == -1 \ and (product_obj.procure_method=='make_to_stock'): warn_msg = _('You plan to sell %.2f %s but you only have %.2f %s available !\nThe real stock is %.2f %s. (without reservations)') % \