Skip to content
Snippets Groups Projects
Commit 54dfc712 authored by Du-ma's avatar Du-ma
Browse files

[FIX] pos_gift_card: use get_unit_price fn to get rounded value


Occasionally a rounding error can occur that returns trailing zeros and a integer on the end.
Since the values are compared, we could be comparing 2 values with a difference of 0.00000001 and end up with an error.

closes odoo/odoo#108613

Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
parent b0316c9e
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ odoo.define('pos_gift_card.PaymentScreen', function(require) {
fields: ['balance'],
});
if(Math.abs(line.price) > gift_card[0].balance) {
if(Math.abs(line.get_unit_price()) > gift_card[0].balance) {
await this.showPopup('ErrorPopup', {
'title': _t("Gift Card Error"),
'body': _t("Gift card balance is too low."),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment