From 4b5a3d575629cb52a06e8baec4ae57e513a457d9 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 25 Sep 2020 13:34:17 +0200 Subject: [PATCH] [FIX] pos_customer_display: don't crash if get_order() is null, that occures if pos_restaurant is enabled --- pos_customer_display/static/src/js/screens.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pos_customer_display/static/src/js/screens.js b/pos_customer_display/static/src/js/screens.js index 5db24048..c9527ce8 100644 --- a/pos_customer_display/static/src/js/screens.js +++ b/pos_customer_display/static/src/js/screens.js @@ -12,7 +12,10 @@ odoo.define('pos_customer_display.screens', function (require) { screens.PaymentScreenWidget.include({ render_paymentlines: function() { - if (this.pos.get_order().get_total_with_tax() === 0) { + if ( + !this.pos.get_order() || + (this.pos.get_order() && this.pos.get_order().get_total_with_tax() === 0) + ) { // Render payment is called each time a new order is created // (and so when lauching the PoS) // in that case, we display the welcome message