From 8699231bc81c2682dd699f0bc2352cf8e0fcf3f3 Mon Sep 17 00:00:00 2001 From: Youssef Bashandy Date: Thu, 23 Nov 2023 16:41:01 +0200 Subject: [PATCH] [FIX] point_of_sale : Removing orderline Steps to reproduce: 1- Install POS module and French Localization 2- Open a session in POS 3- Add an item to the order then remove it and set the quantity to 0 Current behavior before PR: When you try to remove an item from POS while using french localization it gives an error 'null exception'. This happens because we are trying to set the quantity to the order after unlinking the order line and setting the order with null. Desired behavior after PR is merged: The error pop-up is not there anymore and you can remove any item. Now we set the new quantity to the order before unlinking the order to avoid the null exception opw-3607956 closes odoo/odoo#144592 Signed-off-by: Joseph Caburnay (jcb) --- .../static/src/app/screens/product_screen/product_screen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js b/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js index 5705974625a..38fe8467e76 100644 --- a/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js +++ b/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js @@ -363,10 +363,10 @@ export class ProductScreen extends ControlButtonsMixin(Component) { return true; } if (newQuantity >= selectedLine.saved_quantity) { + selectedLine.set_quantity(newQuantity); if (newQuantity == 0) { order._unlinkOrderline(selectedLine); } - selectedLine.set_quantity(newQuantity); return true; } const newLine = selectedLine.clone();