diff options
| author | Christophe Matthieu <chm@odoo.com> | 2018-01-19 12:35:54 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-04-09 09:54:20 +0200 |
| commit | 9961bbf4eb87f281e8631d5471bdcad06eb35440 (patch) | |
| tree | 89bae4902e97c6ba76615d689f3a7c040598f5a7 /addons/web/static/src | |
| parent | d9f7490f556a07e0d31900958adab12e8791e514 (diff) | |
[FIX] web: check domain after action button in kanban
When a user click on an action button, we need to check if the record
match with the domain to remove it from the view if this action change
the record value.
Special case: we filter by active field equal true, if the active field
is available in the data (field present in the kanban view).
opw-1832879
Co-authored-by: Nicolas Martinelli <nim@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_controller.js | 15 |
1 files changed, 15 insertions, 0 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 26f379d4a39..20a8e11cd52 100644 --- a/addons/web/static/src/js/views/kanban/kanban_controller.js +++ b/addons/web/static/src/js/views/kanban/kanban_controller.js @@ -10,6 +10,7 @@ odoo.define('web.KanbanController', function (require) { var BasicController = require('web.BasicController'); var Context = require('web.Context'); var core = require('web.core'); +var Domain = require('web.Domain'); var view_dialogs = require('web.view_dialogs'); var _t = core._t; @@ -228,10 +229,24 @@ var KanbanController = BasicController.extend({ resIDs: record.res_ids, }, on_closed: function () { + var recordModel = self.model.localData[record.id]; + var group = self.model.localData[recordModel.parentID]; + var parent = self.model.localData[group.parentID]; + self.model.reload(record.id).then(function (db_id) { var data = self.model.get(db_id); var kanban_record = event.target; kanban_record.update(data); + + // Check if we still need to display the record + var domain = parent ? parent.domain : group.domain; + if ('active' in data.data && _.pluck(domain, 0).indexOf('active') === -1) { + domain = [['active', '=', true]].concat(domain); + } + var visible = new Domain(domain).compute(data.evalContext); + if (!visible) { + kanban_record.destroy(); + } }); }, }); |
