From c0809dd41d9866c072822b36eae6b57cbc918cc9 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Wed, 25 Apr 2018 13:53:37 +0200 Subject: [FIX] web: reload progressbar values after archiving records Before this, the progressbar values were not updated (both count and progress) after archiving all the records of a column. Multiple things have been done here to update it. Firstly, a optimization had been done to avoid reloading the progressbar when updating a column ; this optimization was not correct due to this precise use case. This will update the progressbar. Secondly, the `aggregateValues` are reset when putting empty groups back in the datapoint. This attribute is used to compute the counter if a `sum_field` is set on the progressbar widget. It needs to be reset because the loop that computes it won't iterate on empty groups. Eventually, the mockRPC of the progressbar route was not taking the `group_by` argument into account (probably a typo). --- addons/web/static/src/js/views/basic/basic_model.js | 4 ++++ 1 file changed, 4 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 e311378eee4..9d4dc877473 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -3842,6 +3842,10 @@ var BasicModel = AbstractModel.extend({ var emptyGroupsIDs = _.difference(_.pluck(previousGroups, 'id'), list.data); _.each(emptyGroupsIDs, function (groupID) { list.data.push(groupID); + var emptyGroup = self.localData[groupID]; + // this attribute hasn't been updated in the previous + // loop for empty groups + emptyGroup.aggregateValues = {}; }); } return $.when.apply($, defs).then(function () { -- cgit v1.2.3