From 0e12fa135882cd5095dbf15fe2f64231c6a84336 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 3 Sep 2020 15:19:26 +0000 Subject: [FIX] web: avoid displaying noContentHelper after kanban quick_create Have a kanban with a filter Quick create a record in one column that won't match the domain Before this commit, the noContent helper was displayed. This was because the count of the group was reset to zero after the web_read_group call. After this commit, the noContent helper is not displayed. Note that in the quick_create situation, the records are not re-fetched i.e. there is no search_read after the read_group. Task-id 2251734 closes odoo/odoo#57066 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/views/basic/basic_model.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'addons/web/static/src/js/views/basic') diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 24373e3b753..5be80268cc6 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -4602,6 +4602,14 @@ var BasicModel = AbstractModel.extend({ // sub-groups // Also keep data if we only reload groups' own data updatedProps.data = oldGroup.data; + if (options.onlyGroups) { + // keep count and res_ids as in this case the group + // won't be search_read again. This situation happens + // when using kanban quick_create where the record is manually + // added to the datapoint before getting here. + updatedProps.res_ids = oldGroup.res_ids; + updatedProps.count = oldGroup.count; + } } _.extend(newGroup, updatedProps); // set the limit such that all previously loaded records -- cgit v1.2.3