I need to know what command to add to the transition of DRAFT > CONFIRMED state of a document in ODOO-8 to make all fields READ ONLY. I've attached an image below to see the fields that can be edited even though the state is confirmed.
I'm new to STACKOVERFLOW, thanks alot and i await replies
You should add the attrs
attribute to each field in the view definition like this:
<field name="field_name" attrs="{'readonly': [('state', '=', 'confirmed')]}"/>
Or, as @CZoellner said, you can do that in the .py:
field_x = fields.Char(string="X", states={'confirmed': [('readonly', True)]})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.