From 2b02aa05f3279113f1f387bb1b15c377bb839dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Todorovich?= Date: Thu, 20 Feb 2020 11:48:57 +0100 Subject: [PATCH] [IMP] Improve javascript show/hide message --- pos_empty_home/static/src/js/screens.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pos_empty_home/static/src/js/screens.js b/pos_empty_home/static/src/js/screens.js index 31ad788a..a7fa5c94 100644 --- a/pos_empty_home/static/src/js/screens.js +++ b/pos_empty_home/static/src/js/screens.js @@ -12,12 +12,12 @@ odoo.define('pos_empty_home.screens', function (require) { var screens = require('point_of_sale.screens'); screens.ProductListWidget.include({ - renderElement: function() { - this._super(); - if (this.product_list.length == 0) { - this.el.querySelector('.product-list-empty-home').style['display'] = 'block'; + set_product_list: function(product_list){ + this._super(product_list); + if (product_list.length) { + $(this.el.querySelector('.product-list-empty-home')).hide(); } else { - this.el.querySelector('.product-list-empty-home').style['display'] = 'none'; + $(this.el.querySelector('.product-list-empty-home')).show(); } }, });