From ffbb32209a6a8d0949453ca0fce4947b03abd9d6 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Wed, 19 Feb 2020 15:00:01 +0000 Subject: [PATCH] [FIX] point_of_sale: Fix js compute_all taxes The compute_all JS-side hasn't be updated since recent changes in the tax computation introduced by: https://github.com/odoo/odoo/commit/9b7d14c6b3caba5cde0b98bfaf8aaf887fc94abd closes odoo/odoo#45801 X-original-commit: d9601cceab365276e43634260be29e2f23749020 Signed-off-by: oco-odoo --- addons/point_of_sale/static/src/js/models.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 51925afd6d7..b3c832cc794 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1906,6 +1906,7 @@ exports.Orderline = Backbone.Model.extend({ var round_tax = this.pos.company.tax_calculation_rounding_method != 'round_globally'; + var initial_currency_rounding = currency_rounding; if(!round_tax) currency_rounding = currency_rounding * 0.00001; @@ -1914,7 +1915,7 @@ exports.Orderline = Backbone.Model.extend({ return (base_amount - fixed_amount) / (1.0 + percent_amount / 100.0) * (100 - division_amount) / 100; } - var base = round_pr(price_unit * quantity, currency_rounding); + var base = round_pr(price_unit * quantity, initial_currency_rounding); var sign = 1; if(base < 0){ @@ -1960,7 +1961,7 @@ exports.Orderline = Backbone.Model.extend({ i -= 1; }); - var total_excluded = recompute_base(base, incl_fixed_amount, incl_percent_amount, incl_division_amount); + var total_excluded = round_pr(recompute_base(base, incl_fixed_amount, incl_percent_amount, incl_division_amount), initial_currency_rounding); var total_included = total_excluded; // 5) Iterate the taxes in the sequence order to fill missing base/amount values.