diff options
| author | Priyanka Kakadiya <pka@odoo.com> | 2018-11-23 06:42:05 +0000 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2019-01-09 09:13:59 +0000 |
| commit | ccb2fffc6556ffbc940d4a92c89bf06bec1656cd (patch) | |
| tree | fe82f7848eaf50a0ee4025e8f51ce874f8a898b8 /addons/web/static/src/js | |
| parent | 6be112ac2c5486815fcf7c291ade83c9e22ac2f9 (diff) | |
[FIX] web: prevent crash in kanban in some cases
Before this commit, if a user tries to group a kanban view by a date or
a datetime interval, then tries to drag and drop a record from one column to
another, then the web client crashes. This is actually an invalid
operation, and is supposed to be disallowed. There is already some code
that properly handle the situation. However, the field attribute was
not properly read in the case of fields of type date/datetime.
Related to Issue: #1911975
Co-authored-by: Mohammed Shekha <msh@openerp.com>
closes odoo/odoo#30029
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_renderer.js | 3 |
1 files changed, 2 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 3dc0cae5540..3e17c65ef66 100644 --- a/addons/web/static/src/js/views/kanban/kanban_renderer.js +++ b/addons/web/static/src/js/views/kanban/kanban_renderer.js @@ -436,7 +436,8 @@ var KanbanRenderer = BasicRenderer.extend({ _setState: function (state) { this.state = state; - var groupByField = state.groupedBy[0]; + // split groupedBy field with ':' as it can be date/datetime field + var groupByField = state.groupedBy.length && state.groupedBy[0].split(":")[0]; var groupByFieldAttrs = state.fields[groupByField]; var groupByFieldInfo = state.fieldsInfo.kanban[groupByField]; // Deactivate the drag'n'drop if the groupedBy field: |
