From ee33593351a148d0f678b36fc01e8524fe1452b6 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 23 Feb 2016 13:52:50 +0100 Subject: [PATCH] [FIX] point_of_sale: round price unit The product price unit should be rounded before being used in any operation. The PoS calls the method `read` in order to get the necessary fields. However, the product price is a non-stored calculated float. In old API, such a field is not rounded by the `read` method. It means that a product price of 28.067 (for example thanks to the use of a pricelist) will be rounded to 28.07 at the server level but not rounded in the PoS JS layer. To lower the impact of the fix, the rounding is done at the JS level, and not in the `_product_price` method. opw-669024 --- addons/point_of_sale/static/src/js/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 0bd1b99f94d..ec61ad943ec 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -821,7 +821,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal this.trigger('change',this); }, get_unit_price: function(){ - return this.price; + return round_di(this.price || 0, this.pos.dp['Product Price']) }, get_base_price: function(){ var rounding = this.pos.currency.rounding;