From 24b068645ab4353c06af2a5ec13a07f533a053cf Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Fri, 24 Mar 2023 09:16:31 +0000 Subject: [PATCH] [FIX] pos_loyalty: not showing error without orderline Steps to reproduce the error: 1. Open a Pos 2. Without any orderline, click on `+-` button 3. You will see an error issue https://github.com/odoo/odoo/issues/115642 closes odoo/odoo#117620 X-original-commit: a588bb7fbe9ad6accaa12ebf1ce59767284c4f12 Signed-off-by: Trinh Jacky (trj) Signed-off-by: Pedram Bi Ria (pebr) --- addons/pos_loyalty/static/src/js/ProductScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pos_loyalty/static/src/js/ProductScreen.js b/addons/pos_loyalty/static/src/js/ProductScreen.js index 6d2cf493ee6..10a3c63fde7 100644 --- a/addons/pos_loyalty/static/src/js/ProductScreen.js +++ b/addons/pos_loyalty/static/src/js/ProductScreen.js @@ -22,7 +22,7 @@ patch(ProductScreen.prototype, "pos_loyalty.ProductScreen", { const _super = this._super; const selectedLine = this.currentOrder.get_selected_orderline(); if (key === "-") { - if (selectedLine.eWalletGiftCardProgram) { + if (selectedLine && selectedLine.eWalletGiftCardProgram) { // Do not allow negative quantity or price in a gift card or ewallet orderline. // Refunding gift card or ewallet is not supported. this.notification.add(