Odoo Help


How to make a field invisible only on create

on 7/30/15, 11:07 AM 1,631 views

I have this field:

<field name="write_date" />  

This is one of the reserved fields of Odoo. In this way, I can see when an input as been updated.

There is a problem: who create the input can select date and hour, even if the actual date written in the database is not alterable.

I would like to make this field invisible only when user create a new input. Using:


make this field always invisible. There is a way to make it visible when I list my input?


Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.



Tarek Mohamed Ibrahim
On 7/30/15, 12:01 PM

I think you do not need to change this field interactively later, i.e. in edit mode, so I think it is sufficient to make it readonly by setting readonly="1", this will resolve your issue

if you prefer to make it invisible in the create time then I think you have to inherit the view and add the following line in your xml inherited view

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

or put 'False' in place of 'None'

Try it and feed me back

Dr Obx
On 7/30/15, 5:56 PM

IMHO 'readonly="1"' should be OK

However write_date keeps date when record was created/updated. If you want have date when record was created you should use create_date instead.

Anyway, if you use readonly="1" it will be invisible whilst record is created, once record is saved it will be displayed.

On 7/31/15, 4:43 AM

I've done with the following code:

&lt;field name="write_date" attrs="{'invisible': [('write_date', '=', False)]}"/> 

Thank you very much!

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

1 follower(s)


Asked: 7/30/15, 11:07 AM
Seen: 1631 times
Last updated: 7/31/15, 7:47 AM