콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5164 화면

I am trying to add a field in the document's kanban view. It displays the label only not the value.

Here is the code.

document_kanban_inspector_inherit.js


_renderFields: function () {

        var options = {mode: 'edit'};

        if (this.records.length === 1) {

            this._renderField('name', options);

            this._renderField('barcode', {

                icon: 'fa fa-barcode',

                mode: 'edit',

            });

            if (this.records[0].data.type === 'url') {

                this._renderField('url', options);

            }

            this._renderField('partner_id', options);

        }

        if (this.records.length > 0) {

            this._renderField('owner_id', options);



            this._renderField('folder_id', {

                icon: 'fa fa-folder o_documents_folder_color',

                mode: 'edit',

            });

        }

    },




How can i do this?

아바타
취소

Did you get this work by any chance?

베스트 답변

I know this is an old question, but for whoever might at some point search for this, here is an answer: you also have to load the fields in the kanban view of documents.document for that field to show on the document inspector. Here is the code i used to load the field building_id:



odoo.define('xxx.DocumentsKanbanView', function (require) {
"use strict";
const DocumentsKanbanView = require("documents.DocumentsKanbanView");

DocumentsKanbanView.include({
init: function () {
this._super.apply(this, arguments);
const fields = ['building_id'];
debugger
_
.defaults(this.fieldsInfo[this.viewType], _.pick(this.fields, fields));
}
});
});


아바타
취소
관련 게시물 답글 화면 활동
3
10월 23
9231
1
9월 23
3502
4
7월 23
6584
1
5월 23
2452
2
4월 23
3042