Skip to Content
Menu
This question has been flagged
1 Reply
5928 Views

These are the states, I just found in model. How can I change this in accordance with odoo17.

1)states={'draft': [('readonly', False)]}

2)states={'done': [('readonly', True)], 'post': [('readonly', True)]}

3) date = fields.Date(states={'done': [('readonly', True)]}, default=fields.Date.context_today, string="Trip Date")

4)states={'done': [('readonly', True)], 'approved': [('readonly', True)], 'reported': [('readonly', True)]}

Avatar
Discard
Best Answer

Hi

Try this in xml.


 1.readonly="state not in ['draft']"

2.readonly="state in ['done', 'post']"

3.readonly="state in ['done']"

4.readonly="state not in ['done', 'approved','reported']"


Hope it helps

Avatar
Discard

How Odoo implemented this in sale order model?