From 21392ab2363c2ca6bdff781179434c04172ff745 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Fri, 7 Jul 2023 14:54:57 +0000 Subject: [PATCH] [FIX] point_of_sale: Correctly update rewards after scanning a product Current behavior: When scanning a product that should trigger a reward, the reward was not applied. Steps to reproduce: - Create a reward that applies a 10% discount on specific products (e.g. Whiteboard pen) - Make sure a barcode is set on the Whiteboard pen product - Open a PoS, and scan the Whiteboard pen product barcode - The reward is not applied opw-3373435 closes odoo/odoo#129406 X-original-commit: 9991d923ec0e7fc74e5d319d43a0052e6e4d7416 Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Robin Engels (roen) --- .../src/overrides/components/product_screen/product_screen.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/pos_loyalty/static/src/overrides/components/product_screen/product_screen.js b/addons/pos_loyalty/static/src/overrides/components/product_screen/product_screen.js index 957fb8ef0a2..669292ff14d 100644 --- a/addons/pos_loyalty/static/src/overrides/components/product_screen/product_screen.js +++ b/addons/pos_loyalty/static/src/overrides/components/product_screen/product_screen.js @@ -107,4 +107,8 @@ patch(ProductScreen.prototype, "pos_loyalty.ProductScreen", { selectedLine.order._updateRewards(); } }, + async _barcodeProductAction(code) { + await this._super(code); + this.currentOrder._updateRewards(); + }, });