From f230b5c71a779a3cb568b8540f1a9cf6700dd99d Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Mon, 16 Sep 2019 08:48:01 +0000 Subject: [PATCH] [FIX] point_of_sale: missing costumer facing display's check Some calls to send_current_order_to_customer_facing_display() method miss the check to the POS config's iface_customer_facing_display property, resulting into an error during the rendering of the template. This bug was introduce by odoo/odoo@5d0afddaf221756378 closes odoo/odoo#36916 Signed-off-by: pimodoo --- addons/point_of_sale/static/src/js/models.js | 9 ++++++--- addons/point_of_sale/static/src/js/screens.js | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index ab01cb1cb29..bb4d3d84351 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -665,7 +665,9 @@ exports.PosModel = Backbone.Model.extend({ var order = new exports.Order({},{pos:this}); this.get('orders').add(order); this.set('selectedOrder', order); - this.send_current_order_to_customer_facing_display(); + if (this.config.iface_customer_facing_display) { + this.send_current_order_to_customer_facing_display(); + } return order; }, /** @@ -2660,8 +2662,9 @@ exports.Order = Backbone.Model.extend({ if(line.has_product_lot){ this.display_lot_popup(); } - - this.pos.send_current_order_to_customer_facing_display(); + if (this.pos.config.iface_customer_facing_display) { + this.pos.send_current_order_to_customer_facing_display(); + } }, get_selected_orderline: function(){ return this.selected_orderline; diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 98404264ea8..db7afa38638 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -551,7 +551,9 @@ var OrderWidget = PosBaseWidget.extend({ selected_orderline.price_manually_set = true; selected_orderline.set_unit_price(val); } - this.pos.send_current_order_to_customer_facing_display(); + if (this.pos.config.iface_customer_facing_display) { + this.pos.send_current_order_to_customer_facing_display(); + } } }, change_selected_order: function() {