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 Change string/label field dynamically in tree view?

By
Bilel
on 3/27/16, 4:40 PM 800 views

Hi,

I would like to change colonne's label/string when changing boolean value:

This solution didn't work:

```

<field name="product_uom_qty" attrs="{'invisible': [('x_is_line_commission','==', True)]}" string="Ordered Qty" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id}" />

<field name="product_uom_qty" attrs="{'invisible': [('x_is_line_commission','!=', True)]}" string="Ordered Value" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id}" />

```

And this solution it work only in form view but didn't work with tree view

https://www.odoo.com/fr_FR/forum/aide-1/question/how-to-create-dynamic-field-labels-20501

And i didn't  know if this solution work or not :

https://answers.launchpad.net/openobject-server/+question/186683


Thx for support

1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 3/28/16, 7:58 AM

Hello,

The method fields_view_get called before rendering the view, so you can override this function to change the 

label string of your fields in a tree view ...

hope this could help

0
Bilel
On 3/27/16, 8:08 PM

Unfortunately,For This moment it's not possible to change label tree form dynamically.

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: 3/27/16, 4:40 PM
Seen: 800 times
Last updated: 3/28/16, 7:58 AM