From 5bb8b9de6f7bdda7cc5eecfae575fdb1511f095b Mon Sep 17 00:00:00 2001 From: "Jacky (trj)" Date: Mon, 30 Aug 2021 13:39:12 +0000 Subject: [PATCH] [FIX] point_of_sale: info button on empty orderline Behavior before the commit: when clicking on the info button from the control buttons, if no orderline was selected, a traceback error happened. After the commit: nothing happens when clicking on the product info button when there's no orderline. Related task id: 2518884 closes odoo/odoo#75728 Signed-off-by: pimodoo --- .../Screens/ProductScreen/ControlButtons/ProductInfoButton.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/Screens/ProductScreen/ControlButtons/ProductInfoButton.js b/addons/point_of_sale/static/src/js/Screens/ProductScreen/ControlButtons/ProductInfoButton.js index 0c0a7b2857d..13fcfd05dc0 100644 --- a/addons/point_of_sale/static/src/js/Screens/ProductScreen/ControlButtons/ProductInfoButton.js +++ b/addons/point_of_sale/static/src/js/Screens/ProductScreen/ControlButtons/ProductInfoButton.js @@ -21,9 +21,9 @@ odoo.define('point_of_sale.ProductInfoButton', function(require) { } onClick() { const orderline = this.env.pos.get_order().get_selected_orderline(); - const product = orderline.get_product(); - const quantity = orderline.get_quantity(); if (orderline) { + const product = orderline.get_product(); + const quantity = orderline.get_quantity(); this.showPopup('ProductInfoPopup', { product, quantity }); } }