summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/static/src/js/models.js
diff options
context:
space:
mode:
authorIvan Yelizariev <iel@odoo.com>2021-01-08 15:02:19 +0000
committerIvan Yelizariev <iel@odoo.com>2021-01-08 15:02:19 +0000
commitdb0b65e547defe3d49c1a31c4671f546aa5156e8 (patch)
treed3b717f331a3546cc7b0159e224fce8377b6a279 /addons/point_of_sale/static/src/js/models.js
parentc7375ebaf8d4baa6e02534425ed634c7264ce90f (diff)
[FIX] point_of_sale: respect setting only_round_cash_method
STEPS: * configure rounding: - cash_rounding=True - only_round_cash_method=True - round method: 1.0 Down * open a session * add products with subtotal in decimals (such as 6.35) * select Bank payment method and process the order BEFORE: error "You have to round your payments lines" AFTER: order is processed and marked as paid --- https://github.com/odoo/odoo/commit/42425996e36d9cb1fc1391402cf6d00df4aea019 opw-2426027 closes odoo/odoo#64270 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/point_of_sale/static/src/js/models.js')
-rw-r--r--addons/point_of_sale/static/src/js/models.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 30e662ed18d..72a0a419c77 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -3337,10 +3337,14 @@ exports.Order = Backbone.Model.extend({
if(!this.pos.config.cash_rounding)
return false;
+ const only_cash = this.pos.config.only_round_cash_method;
var lines = this.paymentlines.models;
for(var i = 0; i < lines.length; i++) {
var line = lines[i];
+ if (only_cash && !line.payment_method.is_cash_count)
+ continue;
+
if(!utils.float_is_zero(line.amount - round_pr(line.amount, this.pos.cash_rounding[0].rounding), 6))
return line;
}