diff options
| author | Christophe Matthieu <chm@odoo.com> | 2017-03-21 15:30:58 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | eaa66d11568b415b8d6b4c7a17a058b5ec1df4a6 (patch) | |
| tree | 822fe86e984e69f989c3574936fe1792ae96fe9b /addons/web/static/src/js/fields/relational_fields.js | |
| parent | e1eea38f2f940fbe252273a5a9d4d03474f81d0a (diff) | |
[REF] web: change internal representation of fields and view meta datas
* Data manager load_view returns a viewInfo object
* ViewInfo contains: the arch, fields and fieldsInfo objects, and some extra informations
* The fields come from the server and are frozen, without any view attributes (depend of the model).
* The fieldsInfo contains every view attributes and informations.
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 408b4c5a3ea..923e8400b1e 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -520,7 +520,7 @@ var FieldX2Many = AbstractField.extend({ this._super.apply(this, arguments); this.operations = []; this.isReadonly = this.mode === 'readonly'; - this.view = this.field.views.tree || this.field.views.kanban; + this.view = this.attrs.views.list || this.attrs.views.kanban; this.activeActions = {}; var arch = this.view && this.view.arch; if (arch) { @@ -704,7 +704,7 @@ var FieldX2Many = AbstractField.extend({ _.extend(event.data, { context: this.record.getContext({fieldName: this.name}), domain: this.record.getDomain({fieldName: this.name}), - form_view: this.field.views && this.field.views.form, + form_view: this.attrs.views && this.attrs.views.form, readonly: this.mode === 'readonly', string: this.string, }); @@ -799,6 +799,7 @@ var FieldOne2Many = FieldX2Many.extend({ domain: this.record.getDomain({fieldName: this.name}), context: this.record.getContext({fieldName: this.name}), field: this.field, + attrs: this.attrs, on_save: function (record) { this._setValue({ operation: 'ADD', @@ -867,7 +868,7 @@ var FieldMany2Many = FieldX2Many.extend({ context: this.record.getContext({fieldName: this.name}), title: _t("Add: ") + this.string, no_create: this.nodeOptions.no_create || !this.activeActions.create, - fields_view: this.field.views.form, + fields_view: this.attrs.views.form, on_selected: function (res_ids) { var new_ids = _.difference(res_ids, self.value.res_ids); if (new_ids.length) { @@ -911,6 +912,8 @@ var FieldMany2ManyTags = AbstractField.extend({ 'keydown .o_form_field_many2one input': '_onKeyDown', }), + fetchSubFields: true, + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- |
