Odoo Help


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.


How to make many2one field invisible

on 5/31/16, 7:00 AM 302 views

I am trying to make a field autre_id invisible 

I tryed many methods to do that and i did not work

this my method:


        'autre_id':fields.many2one('mon_module.autre', 'الحالة الإجتماعية', required=False),


     <field name="autre_id" attrs="{'invisible': [(' autre_id ', '=', 'False')]}"/>

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

Can you help me to solve that

and thinks 

On 5/31/16, 2:13 PM

Thank you Pawan, but i tryed your solution and it does not work 

are you getting any error? can u provide your code..

on 6/1/16, 4:14 AM

no i don't hava any error, but this field still visble in my view

on 6/1/16, 4:16 AM

then check if you have defined that field again in your view.. after making it invisible.. or that view is inherited and that field is defined again.... or, is that view only loading?

on 6/1/16, 6:41 AM


| 4 3 5
Hyderabad, India

On 5/31/16, 9:31 AM


you can simply use :

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

we use attrs in the case when we want to hide/readonly a filed on basis of some condition, for ex:

if you want to hide autre_id when your state is 'open',  you can use:

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

Hope this help!

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)


Asked: 5/31/16, 7:00 AM
Seen: 302 times
Last updated: 5/31/16, 2:13 PM