diff options
| author | Victor Feyens <vfe@odoo.com> | 2019-10-17 11:40:16 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-10-18 10:25:58 +0000 |
| commit | e92d302d2fb4e2f2483345b8463d791bac702c10 (patch) | |
| tree | a34c46c38abfea81ea44b26a2f1e2a778518c521 /addons/web/static/src/js | |
| parent | 86681cd0b46a43c2b16177e903afde6c5cea1221 (diff) | |
[FIX] web: kanban archive / unarchive all
Since https://github.com/odoo/odoo/commit/f896afcc8a54eae3efcdf034e3fd256942f7fa78,
(un)archive all triggered toggle_active on all records, which doesn't consider
whether we want to archive/unarchive and on which records...
Closes #38903
closes odoo/odoo#39022
X-original-commit: 2c89cb0c92fc593e2e323e322c9228de268f64cf
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_controller.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/addons/web/static/src/js/views/kanban/kanban_controller.js b/addons/web/static/src/js/views/kanban/kanban_controller.js index 03d84bc5c8c..c51c11ebe81 100644 --- a/addons/web/static/src/js/views/kanban/kanban_controller.js +++ b/addons/web/static/src/js/views/kanban/kanban_controller.js @@ -523,16 +523,18 @@ var KanbanController = BasicController.extend({ */ _onToggleActiveRecords: function (ev) { var self = this; + var archive = ev.data.archive; var column = ev.target; var recordIds = _.pluck(column.records, 'db_id'); if (recordIds.length) { - this.model - .toggleActive(recordIds, column.db_id) - .then(function (dbID) { - var data = self.model.get(dbID); - self.renderer.updateColumn(dbID, data); - self._updateEnv(); - }); + var prom = archive ? + this.model.actionArchive(recordIds, column.db_id) : + this.model.actionUnarchive(recordIds, column.db_id); + prom.then(function (dbID) { + var data = self.model.get(dbID); + self.renderer.updateColumn(dbID, data); + self._updateEnv(); + }); } }, }); |
