From 89e9ebdccf86ac9bacba034f87cfaef88809ec37 Mon Sep 17 00:00:00 2001 From: IEL Date: Thu, 29 Oct 2020 16:14:13 +0000 Subject: [PATCH] [FIX] pos_cash_rounding: fixup float_is_zero usage WHY: * float_is_zero doesn't work without second argument https://github.com/odoo/odoo/blob/c90427dfba26854cda5d54f813cccc4948685077/addons/web/static/src/js/core/utils.js#L59-L62 * the fixed line of code was introduced in #60642 closes odoo/odoo#61097 X-original-commit: 792ebaf8494a42f91e4251acf2f74f89ff9f5e6e Signed-off-by: Ivan Yelizariev // IEL --- 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 d1a1ed7fe6f..5b76c31f7f3 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -3262,7 +3262,7 @@ exports.Order = Backbone.Model.extend({ var rounding_applied = total - (this.pos.config['iface_tax_included'] === "total"? this.get_subtotal(): this.get_total_with_tax()); // because floor and ceil doesn't include decimals in calculation, we reuse the value of the half-up and adapt it. - if (utils.float_is_zero(rounding_applied)){ + if (utils.float_is_zero(rounding_applied, this.pos.currency.decimals)){ // https://xkcd.com/217/ return 0; } else if(this.pos.cash_rounding[0].rounding_method === "UP" && rounding_applied < 0) {