Hope all is well for you guys, gday.
So I inherited a field called date_done
from stock.picking
model, which has readonly:true
attribute by default. I revoked it to readonly but not in 'assigned' status
for all Odoo user in the code below :
<field name="date_done" groups="base.group_user" position="attributes" >
<attribute name="attrs">{'readonly':[('state','not in',('assigned'))],'invisible':['|',('state','not in',('assigned','done'))]}</attribute>
</field>
Then, i want to add one group called change_date_group_privilege
that later will have readonly but not in 'assigned' + 'done' status
attributes.
In the end, i expect that the base.group_user
will only able to change field when the status is not in assigned
, and change_date_group_privilege
will be able to change when the status is not in assigned + done
.
I cannot simply add change_date_group_privilege
into groups="base.group_user"
, because i also need to add 'done'
status inside readonly':[('state','not in',('assigned'))]
, which later will also give base.group_user
privilege that i don't want.
How is it possible to add condition in this XML block of code? And if there's other way i'd be glad to get through it.
Thank you for your help.