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 use fields_view_get() to change a value of a single element ?

By
luis
on 5/29/13, 6:33 PM 1,135 views

In model sale order line I add a field "image_ref", I'd like to pass the value of this field to an icon in the sale order line view. So every time it change the product. change the icon.

I know that I can do this using fields_view_get(), but I don't know exactly how it works, I understand that everything does the py and the view is not modified.

I'm beginning with this.

def fields_view_get(self, cr, uid, view_id=None, view_type='tree', context=None, toolbar=False,submenu=False):
        result = super(sale_order_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)

        active_id = context.get('active_id', False)

        res['fields'][field]['icon'] = image_desc

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

0 follower(s)

Stats

Asked: 5/29/13, 6:33 PM
Seen: 1135 times
Last updated: 3/16/15, 8:10 AM