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 hide a column in Purchase Order lines? [Closed]

By
Anabela Damas
on 3/5/13, 2:24 PM 3,550 views

The Question has been closed

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

Hello,

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?

1
eLBati
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
1

Felipe

--Felipe--
962
| 5 3 8
Bogotá, Colombia
--Felipe--
Informatics engineer Industrial engineer
Felipe
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

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