Odoo Help

Welcome!

This community 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.

0

How to define custom list column for widget?

By
Ratmil Torres
on 2/10/15, 2:27 PM 772 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');

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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