From 1eaa36faf8447d6fbe80f4bcdb512dd4505827d8 Mon Sep 17 00:00:00 2001
From: roen-odoo <roen@odoo.com>
Date: Fri, 25 Nov 2022 15:12:56 +0000
Subject: [PATCH] [FIX] pos_loyalty: fix typo in pos_loyalty

Current behavior:
If you create an empty Db and just create one coupon program for the PoS
, the `enter_code` button is not displayed. This happens because the
condition to show the button was looking for program type `coupon`
instead of `coupons`.

Steps to reproduce:
- Create an empty Db (Important)
- Install PoS and PoS Loyalty
- Create a coupon program for the PoS
- Open the PoS, the `enter_code` button is not displayed

opw-3078726

closes odoo/odoo#106585

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
---
 .../pos_loyalty/static/src/js/ControlButtons/PromoCodeButton.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/pos_loyalty/static/src/js/ControlButtons/PromoCodeButton.js b/addons/pos_loyalty/static/src/js/ControlButtons/PromoCodeButton.js
index 99ee4094ea04..554c99f92dd3 100644
--- a/addons/pos_loyalty/static/src/js/ControlButtons/PromoCodeButton.js
+++ b/addons/pos_loyalty/static/src/js/ControlButtons/PromoCodeButton.js
@@ -31,7 +31,7 @@ PromoCodeButton.template = 'PromoCodeButton';
 ProductScreen.addControlButton({
     component: PromoCodeButton,
     condition: function () {
-        return this.env.pos.programs.some(p => ['coupon', 'promotion', 'gift_card'].includes(p.program_type));
+        return this.env.pos.programs.some(p => ['coupons', 'promotion', 'gift_card'].includes(p.program_type));
     }
 });
 
-- 
GitLab