From b781565e360a306b0a0478f245c804509e97fbf6 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 31 Aug 2017 15:54:55 +0200 Subject: [REF] web: allow to distinguish kanban/list x2m in LESS --- addons/web/static/src/js/fields/relational_fields.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/fields/relational_fields.js') diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index d70071b2fec..5c2b1795e9f 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -715,16 +715,19 @@ var FieldX2Many = AbstractField.extend({ return $.when(); } var arch = this.view.arch; + var viewType; if (arch.tag === 'tree') { + viewType = 'list'; this.renderer = new ListRenderer(this, this.value, { arch: arch, mode: this.mode, addCreateLine: !this.isReadonly && this.activeActions.create, addTrashIcon: !this.isReadonly && this.activeActions.delete, - viewType: 'list', + viewType: viewType, }); } if (arch.tag === 'kanban') { + viewType = 'kanban'; var record_options = { editable: false, deletable: false, @@ -733,9 +736,10 @@ var FieldX2Many = AbstractField.extend({ this.renderer = new KanbanRenderer(this, this.value, { arch: arch, record_options: record_options, - viewType: 'kanban', + viewType: viewType, }); } + this.$el.addClass('o_field_x2many o_field_x2many_' + viewType); return this.renderer ? this.renderer.appendTo(this.$el) : this._super(); }, /** -- cgit v1.2.3