From eb9fedd2df4b6919cfc441ae3b41e08c42c1dc35 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Thu, 7 Apr 2022 15:19:15 +0000 Subject: [PATCH] [FIX] point_of_sale: make background loading silent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Loading in background is supposed be background and not block UI after 3 sec of loading. STEPS: * In `pos.config` set `[x] Limited Products Loading`, and `[x] ​Load all remaining products in the background` * add enough products to POS, e.g. 40 000 * Open pos BEFORE: background loading triggers UI Blocking if it takes more than 3 seconds AFTER: products/partners are loaded in background without interrupting UI --- opw-2817770 closes odoo/odoo#88330 X-original-commit: 64232893886c6613212885a382b6f0732c091ef2 Signed-off-by: Masereel Pierre --- addons/point_of_sale/static/src/js/models.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 218992d845b..e7b84b9e11a 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -437,7 +437,7 @@ class PosGlobalState extends PosModel { offset: page * this.config.limited_products_amount, limit: this.config.limited_products_amount, }], - }); + }, { shadow: true }); this._loadProductProduct(products); page += 1; } while(products.length == this.config.limited_products_amount); @@ -459,7 +459,7 @@ class PosGlobalState extends PosModel { }, ], context: this.env.session.user_context, - }); + }, { shadow: true }); this.db.add_partners(partners); i += 1; } while(partners.length);