From be4d4892f60a6d395bf138711f67f63b2f3925ba Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 18 Jul 2023 12:55:45 +0000 Subject: [PATCH] [FIX] l10n_fr_pos_cert: allow you to remove reward line in FR PoS Current behavior: When a reward line had 0 quantity, it was considered as active and the points were deducted from the customer's balance. Steps to reproduce: - Install l10n_fr_pos_cert - Change the Current company to FR company - Create a loyalty card program - Open the POS and add a product to the order to get points and trigger the reward. - Remove the reward line, it should go to 0 quantity instead of being removed. - The point are still removed from the customer's balance. opw-3372998 closes odoo/odoo#132573 X-original-commit: f170bebb38fff044a9f0e247095adc3aaf5a5074 Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Robin Engels (roen) --- addons/l10n_fr_pos_cert/static/src/js/pos.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/l10n_fr_pos_cert/static/src/js/pos.js b/addons/l10n_fr_pos_cert/static/src/js/pos.js index ebe93775487..da84fde49fd 100644 --- a/addons/l10n_fr_pos_cert/static/src/js/pos.js +++ b/addons/l10n_fr_pos_cert/static/src/js/pos.js @@ -20,6 +20,12 @@ patch(PosStore.prototype, { }, disallowLineQuantityChange() { const result = super.disallowLineQuantityChange(...arguments); + let selectedOrderLine = this.selectedOrder.get_selected_orderline(); + //Note: is_reward_line is a field in the pos_loyalty module + if (selectedOrderLine.is_reward_line) { + //Always allow quantity change for reward lines + return false || result; + } return this.is_french_country() || result; }, });