[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 <pimodoo@users.noreply.github.com>
This commit is contained in:
Jacky (trj)
2021-08-31 10:01:16 +00:00
parent 4e31e49c99
commit 5bb8b9de6f
@@ -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 });
}
}