Skip to content
Permalink
Browse files

[FIX] web: correctly update this.widgets

  • Loading branch information...
Polymorphe57 committed Mar 12, 2019
1 parent 835d075 commit 4a9d417d70cda894f48ec274258043b5a335d1c9
@@ -510,12 +510,15 @@ var BasicRenderer = AbstractRenderer.extend({
var oldAllFieldWidgets = this.allFieldWidgets;
this.allFieldWidgets = {}; // TODO maybe merging allFieldWidgets and allModifiersData into "nodesData" in some way could be great
this.allModifiersData = [];
var oldWidgets = this.widgets;
this.widgets = [];
return this._renderView().then(function () {
_.each(oldAllFieldWidgets, function (recordWidgets) {
_.each(recordWidgets, function (widget) {
widget.destroy();
});
});
_.invoke(oldWidgets, 'destroy');
});
},
/**
@@ -396,8 +396,6 @@ var KanbanRenderer = BasicRenderer.extend({
*/
_renderView: function () {
var self = this;
var oldWidgets = this.widgets;
this.widgets = [];

// render the kanban view
var isGrouped = !!this.state.groupedBy.length;
@@ -418,7 +416,6 @@ var KanbanRenderer = BasicRenderer.extend({
self.$el.toggleClass('o_kanban_ungrouped', !isGrouped);
self.$el.append(fragment);
self._toggleNoContentHelper();
_.invoke(oldWidgets, 'destroy');
if (self._isInDom) {
_.invoke(self.widgets, 'on_attach_callback');
}

0 comments on commit 4a9d417

Please sign in to comment.
You can’t perform that action at this time.