Odoo Help


How to hide a column in Purchase Order lines? [Closed]

Anabela Damas
on 3/5/13, 2:24 PM 4,443 views

The Question has been closed

Anabela Damas
on 04/19/2013 15:01:13


I need to hide the price in Purchase Quotation, I've tried some diferent ways to do it, but I just can hide the column for all the states.

I just need when the state is draft and sent to hide the price...

I've tried this way:

<field name="price_unit" attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>

this gave me this error :

Uncaught Error: QWeb2 - template['ListView.rows']: Runtime Error: Error: QWeb2 - template['ListView.row']: Runtime Error: Error: Unknown field state in domain [["state","not in",["draft","sent"]]]

I've tried this way:

<field name="price_unit" invisible="[('state','=','draft')]"/>

and this :

<field name="price_unit" invisible="[('state','in',('draft','sent'))]"/>

this code hide the column to all the states...

I'm trying to change in the code of purchase_view.xml just to learn how to do it, but I need to do a separate module to make that change... Someone know how can I do that?

On 3/6/13, 3:50 AM

If you want to hide the price when order is draft or sent, use the following

<field name="price_unit" attrs="{'invisible': [('state','in',('draft','sent'))]}"/>

Remember to add the state field to your view, it can be invisible:

<field name="state" invisible="1" />

This <field name="state" invisible="1" /> makes the diference, but I used the attrs in here : <field name="price_unit" attrs="{'invisible': [('state','in',('draft','sent'))]}"/> and for the state "cancelled" this field is also invisible!!! Do you know why?

Versão Integral, Anabela Damas
on 3/6/13, 7:36 AM



| 5 5 8
Bogotá, Colombia
Informatics engineer Industrial engineer
On 3/5/13, 3:37 PM

Try this alone.

<field name="price_unit" attrs="{'invisible': [('state','=','draft')]}/>

although this should work to

<field name="price_unit" attrs="{'invisible': [('state','in',('draft','sent'))]}/>

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.


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

2 follower(s)


Asked: 3/5/13, 2:24 PM
Seen: 4443 times
Last updated: 8/23/15, 11:13 AM