In a form view, what way would you have a field only be editable when the object is crated and not editable afterwards.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- सीआरएम
- e-Commerce
- लेखांकन
- इन्वेंटरी
- PoS
- Project
- MRP
This question has been flagged
An object on create will not have an id. Afterwards, it will always have one.
Taking advantage of this behaviour, the id can be used to set the readonly attribute.
<field name="id" invisible="1"/>
<field name="uneditable_field" attrs="{'readonly': [('id', '!=', False)]}"/>
Well done. I was stuggled with this. I didn't think to add the "id" field as invisible to make it available in the domain. Thanks for sharing! J
nice post.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
0
दिस॰ 19
|
6294 | ||
|
1
अग॰ 23
|
2033 | ||
|
0
अप्रैल 21
|
3259 | ||
|
1
जुल॰ 19
|
7016 | ||
|
6
जुल॰ 24
|
45697 |