summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorAdrien Dieudonne <adr@odoo.com>2017-11-09 10:15:57 +0100
committerAdrien Dieudonne <adr@odoo.com>2017-11-09 11:45:04 +0100
commitfe4f63d3259e84e1d64c6f9bf30e184756ab24b4 (patch)
tree7f24f71ab297388877441e016a405042dfc0ff8b /addons/web/static/src/js
parenta25358eae37f0c33f5354d730e6a21c6b50bce52 (diff)
[FIX] web: create in editable grouped list views
Before this commit, an issue occured when you tried to create a new record in a editable grouped list view. A new line was created with an undefined group. Editable grouped list views are not supported. So now, we have to switch on the form view when you click on create. This behavior is already implemented when you open an existing record.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/list/list_controller.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/views/list/list_controller.js b/addons/web/static/src/js/views/list/list_controller.js
index 460ad5de100..67cc6271509 100644
--- a/addons/web/static/src/js/views/list/list_controller.js
+++ b/addons/web/static/src/js/views/list/list_controller.js
@@ -355,8 +355,8 @@ var ListController = BasicController.extend({
// trigger a click on the main bus, which would be then caught by the
// list editable renderer and would unselect the newly created row
event.stopPropagation();
-
- if (this.editable) {
+ var state = this.model.get(this.handle, {raw: true});
+ if (this.editable && !state.groupedBy.length) {
this._addRecord();
} else {
this.trigger_up('switch_view', {view_type: 'form', res_id: undefined});