Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5156 Vizualizări

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?

Imagine profil
Abandonează

Did you get this work by any chance?

Cel mai bun răspuns

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));
}
});
});


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
oct. 23
9187
1
sept. 23
3474
4
iul. 23
6486
1
mai 23
2437
2
apr. 23
3027