Odoo Help

0

How to define custom list column for widget?

By
Ratmil Torres
on 2/10/15, 2:27 PM 1,112 views

I am developing a custom widget.

Something like:

instance.web.form.widgets.add('MyWidget', 'instance.mymodule.MyWidget');

instance.mymodule.MyWidget = instance.web.form.AbstractField.extend( {
    template: "MyTemplate",

   //Other definitions...

});

This is working OK. Now I want to define how the cells for a treeview look for this widget.

This is what I've tried:

instance.web.list.columns.add('MyWidget', 'instance.fieldservice.MyColumnList');

instance.fieldservice.MyColumnList = instance.web.list.Column.extend({
        format: function (row_data, options) {
            return 'MyColumn';
        },

    });

 

0
Ratmil Torres
On 2/10/15, 3:05 PM

I found the answer:

instance.web.list.columns.add('field.MyWidget', 'instance.fieldservice.MyColumnList');

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 2/10/15, 2:27 PM
Seen: 1112 times
Last updated: 3/16/15, 8:10 AM