summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-04-14 23:40:18 +0200
committerGéry Debongnie <ged@odoo.com>2017-04-15 15:00:05 +0200
commita21e2593ceba35faab216859375da5cf5951d3a6 (patch)
tree725168d03cd7898765a45efd4a992b5054469701 /addons/web/static/src
parentf6c20c61d62708478bc75246a644d0982eeadd08 (diff)
[FIX] web: FieldX2Many: don't ignore mode attribute
The 'mode' attribute can be used for x2many fields to force the view mode. Before this rev., it was ignored and if a tree view existed in the view description, it was selected by default. This was mainly a problem in mobile as in this case, kanban views are prefered, and the data_manager forces the mode to be kanban, so the data was fetched according to the kanban view fields, but later on the list view was instantiated instead of kanban by the x2many field, so it crashed if both views didn't share the exact same fields.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index 4c05946cf23..06f38abffbb 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -532,7 +532,7 @@ var FieldX2Many = AbstractField.extend({
this._super.apply(this, arguments);
this.operations = [];
this.isReadonly = this.mode === 'readonly';
- this.view = this.attrs.views.list || this.attrs.views.kanban;
+ this.view = this.attrs.views[this.attrs.mode];
this.activeActions = {};
this.recordParams = {fieldName: this.name, viewType: this.viewType};
var arch = this.view && this.view.arch;