Technical mailing list archives

Dynamic view based on whether the record has been saved or is being created

MONK Software, Leonardo Donelli
- 05/19/2015 10:11:20
I need to display the view in a different way if the record is being
created vs the record has already been created and is being modified.

Particularly, I want to make some fields non-readonly only if the
record is being created for the first time.
I tried using an attrs domain based on ID (I assume a record not yet
saved does not have an ID) but it doesn't seem to work, the field is
always readonly. I tried different domains, mainly:
 * {'readonly': ['!', ('id', '=?', 0)]}
 * {'readonly': [('id', '=', False)}

And some others, but none worked. Any ideas? I thought about using an
additional field that is False by default and I set as True on write
and create, which I think should work, but I was looking for an less
intricated solution.