From 463f3f48a1f87681d3d4538e9c9d730e6f51372c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Thu, 23 Apr 2015 17:54:12 +0200 Subject: [PATCH] [IMP] pos_loyalty: resale rewards should not be available to customers without points --- addons/pos_loyalty/static/src/js/loyalty.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/pos_loyalty/static/src/js/loyalty.js b/addons/pos_loyalty/static/src/js/loyalty.js index 90040ea6ee3..75bed07fcf5 100644 --- a/addons/pos_loyalty/static/src/js/loyalty.js +++ b/addons/pos_loyalty/static/src/js/loyalty.js @@ -234,7 +234,9 @@ models.Order = models.Order.extend({ continue; } else if(reward.type === 'gift' && reward.point_cost > this.get_spendable_points()) { continue; - } + } else if(reward.type === 'resale' && this.get_spendable_points() <= 0) { + continue; + } rewards.push(reward); } return rewards; @@ -424,7 +426,6 @@ screens.OrderWidget.include({ } if (this.pos.loyalty && - order.get_client() && this.getParent().action_buttons && this.getParent().action_buttons.loyalty) {