[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
This commit is contained in:
Nicolas Martinelli 2016-02-23 13:52:50 +01:00
parent 2230bee0c5
commit ee33593351
1 changed files with 1 additions and 1 deletions

View File

@ -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;