From fc132665d77ec630b45b0aec808b32b6797a57dc Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Fri, 17 Apr 2015 11:46:11 +0200 Subject: [PATCH] [FIX] point of sale: Rounding method By default, the point of sale awlways uses the rounding method per line. But the accounting configuration allows to use the globally rounding method, this is why the point of sale must consider this configuration. Inspired from the compute_all of account.tax model within addons/account/account.py. opw:632537 --- addons/point_of_sale/static/src/js/models.js | 5 ++++- 1 file changed, 4 insertions(+), 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 13422c7f9e8..f18059905e2 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -135,7 +135,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal loaded: function(self,users){ self.user = users[0]; }, },{ model: 'res.company', - fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id'], + fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'tax_calculation_rounding_method'], ids: function(self){ return [self.user.company_id[0]] }, loaded: function(self,companies){ self.company = companies[0]; }, },{ @@ -861,6 +861,9 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal var self = this; var res = []; var currency_rounding = this.pos.currency.rounding; + if (this.pos.company.tax_calculation_rounding_method == "round_globally"){ + currency_rounding = currency_rounding * 0.00001; + } var base = price_unit; _(taxes).each(function(tax) { if (tax.price_include) {