From 4e8f84053d1f306924a2e5fd99e5cf3fa7a9bf74 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 20 May 2015 09:49:52 +0200 Subject: [PATCH] [FIX] pos_restaurant: changed unit caused issue on splitting Commit 0fd51c2e6 changed the unit rounding from units from 1 to 0.001, it was done mainly because it's the default unit and in the interface we see quantities with 3 decimals after the floating point, so people might expect to be able to set floating point quantities. This change caused an issue when splitting a bill in the pos restaurant, instead of a click being a piece of the product, it was 0.001 part of a product. This fix overrides the rounding of units in this case. closes #6780 opw-639865 --- addons/pos_restaurant/static/src/js/splitbill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pos_restaurant/static/src/js/splitbill.js b/addons/pos_restaurant/static/src/js/splitbill.js index 81591ccc589..ee55402c835 100644 --- a/addons/pos_restaurant/static/src/js/splitbill.js +++ b/addons/pos_restaurant/static/src/js/splitbill.js @@ -45,7 +45,7 @@ function openerp_restaurant_splitbill(instance, module){ } }else{ if( split.quantity < line.get_quantity()){ - split.quantity += line.get_unit().rounding; + split.quantity += line.get_unit().is_unit ? 1 : line.get_unit().rounding; if(split.quantity > line.get_quantity()){ split.quantity = line.get_quantity(); }