[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) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
This commit is contained in:
roen-odoo
2023-08-22 18:59:52 +02:00
parent 049caf6e92
commit be4d4892f6
@@ -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;
},
});