diff options
| author | Martin Geubelle <mge@odoo.com> | 2017-05-12 11:34:51 +0200 |
|---|---|---|
| committer | Martin Geubelle <mge@odoo.com> | 2017-05-15 14:55:21 +0200 |
| commit | 2fb4cf46d23149aabbc1a03791d27430fc6b9ce1 (patch) | |
| tree | f4aee3ed4be6c10fc606017c23115afabb830252 /addons/web/static/src/js | |
| parent | feb4a8986d3aed2643832a8094caf9bf26fc69b6 (diff) | |
[FIX] web: Kanban: correctly destroy old widget after update
The attribute `widgets` has been renamed in rev https://github.com/odoo/odoo/commit/7ff8aa73e17b281b3e2bc4c7275d020eab0204e7#commitcomment-22116249
However, KanbanRenderer still uses a `widgets` attribute, not for the fields
widgets but for its columns (or records if ungrouped).
These widgets weren't correctly destroyed since then.
This was causing an issue when you were trying to quick create a record after a
column creation (that generates an update): the quick create was added in the
first old column (which was not in the DOM anymore) so you couldn't see it.
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_renderer.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/kanban/kanban_renderer.js b/addons/web/static/src/js/views/kanban/kanban_renderer.js index 8152ce4987b..7bfe21e66a9 100644 --- a/addons/web/static/src/js/views/kanban/kanban_renderer.js +++ b/addons/web/static/src/js/views/kanban/kanban_renderer.js @@ -269,6 +269,8 @@ var KanbanRenderer = BasicRenderer.extend({ * @private */ _renderView: function () { + var oldWidgets = this.widgets; + this.widgets = []; var isGrouped = !!this.state.groupedBy.length; this.$el.toggleClass('o_kanban_grouped', isGrouped); this.$el.toggleClass('o_kanban_ungrouped', !isGrouped); @@ -281,7 +283,7 @@ var KanbanRenderer = BasicRenderer.extend({ this._renderUngrouped(fragment); } this.$el.append(fragment); - return this._super.apply(this, arguments); + return this._super.apply(this, arguments).then(_.invoke.bind(_, oldWidgets, 'destroy')); }, }); |
