Odoo Help


How to hide and show a field based on the edit mode or view mode?

on 3/29/15, 3:35 AM 2,952 views

How to hide and show a field based on the edit mode or view mode in odoo for example I want to show a field in one2many tree when the user click on edit or create button hide the field when the user click on save button view?

Your help is really appreciated

--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 3/29/15, 6:22 AM


To make the field appear only on edit/create you can use:

<field name="name" class="oe_edit_only"/>


Again... why is it not documented!? (Anyhow, thanks for the solution.)

Aron Lorincz
on 4/10/18, 5:15 AM
Jérémy Kersten (jke)
on 4/10/18, 5:22 AM

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--

| 3 3 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/29/15, 6:21 AM


You can use the class oe_edit_ony

<div class="oe_edit_only">
  <field name="your_field/>

Take a look in res partner form, where "Is a company" is using this class !

On 3/29/15, 8:01 AM

Thanks but class="oe_edit_only" is not working when the field is in the one2many field  it will only disable it

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/29/15, 3:35 AM
Seen: 2952 times
Last updated: 4/10/18, 5:15 AM