From 7718f12c8b8e48a210aad2d1b7b2405f4ae4e343 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Wed, 15 Feb 2023 15:14:08 +0000 Subject: [PATCH] [FIX] point_of_sale: allow to refund less than one quantity Before this commit: if you had a pos order with one product and one quantity, it wasn't possible to refund less that one quantity. Steps to reproduce: 1. Create POS order with any product -> Qty = 1.0 2. Go to the refund page -> Select Order -> Update Qty to 0.5 -> Click on the 'Refund' button The solution is to keep the input quantity in case of a single product refund. issue https://github.com/odoo/odoo/issues/112291 closes odoo/odoo#115671 X-original-commit: d7baf99405d2b5ee092a38e2beb3b201292b9345 Signed-off-by: Trinh Jacky (trj) Signed-off-by: Pedram Bi Ria (pebr) --- .../static/src/js/Screens/TicketScreen/TicketScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/Screens/TicketScreen/TicketScreen.js b/addons/point_of_sale/static/src/js/Screens/TicketScreen/TicketScreen.js index 7320c4332ed..69791a06955 100644 --- a/addons/point_of_sale/static/src/js/Screens/TicketScreen/TicketScreen.js +++ b/addons/point_of_sale/static/src/js/Screens/TicketScreen/TicketScreen.js @@ -471,7 +471,7 @@ export class TicketScreen extends IndependentToOrderScreen { const toRefundDetail = this._getToRefundDetail(orderline); const refundableQty = orderline.get_quantity() - orderline.refunded_qty; - if (this.env.pos.isProductQtyZero(refundableQty - 1)) { + if (this.env.pos.isProductQtyZero(refundableQty - 1) && toRefundDetail.qty === 0) { toRefundDetail.qty = 1; } return true;