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

I have a tree view in which I want to display a column depending on the value of another field. To be specific, in the `Inventory` app, I want to add a column in the tree view when the picking type is 'Internal Transfers'. I do not want to show the same column in any other picking type.


Please note, I am customizing this in Odoo Enterprise Edition.


I did `attrs="{'invisible': [('x_picking_type_name','=', 'Internal Transfers')]}"`, where `x_picking_type_name` is a custom field in the model `stock.picking`. I am able to hide values in the records but the column remains in other picking types (i.e. picking types other than 'Internal Transfers').


I suppose, there is a way around with context but I could not make it work. I will appreciate any help on this.

Imagine profil
Abandonează
Cel mai bun răspuns

There isn't a way to do this.  Either the field is visible or not, you can only hide values inside that field.

You would have to have two menus, with two different views - one for Internal Transfers, one for NOT Internal Transfers.

Imagine profil
Abandonează
Cel mai bun răspuns

According to Mohamad Chamra in this post https://www.odoo.com/es_ES/forum/ayuda-1/how-to-add-a-field-conditional-to-tree-view-of-customer-14707#answer_198626

attrs="{'invisible':[('customer','!=',True)]}"


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
nov. 24
20043
1
sept. 23
2916
3
mai 23
5495
7
apr. 23
48835
1
dec. 22
7728