Hello,
I have in my form, a readonlyIf I try to put a control so that only users of the admin group can modify the record but I can’t. Can you tell me what I missed please?
readonlyIf="archived || __group__.code != 'admins'"
Hello,
I have in my form, a readonlyIf I try to put a control so that only users of the admin group can modify the record but I can’t. Can you tell me what I missed please?
readonlyIf="archived || __group__.code != 'admins'"
Hello,
Please try like this
readonlyIf=
"group.code != 'admins'"
I just did what you suggested and it didn’t work. The readonly is always applied regardless of the logged in user.
readonlyIf="group.code != 'admins'">
Hello,
<action-attrs name="action-readonly"> <attribute name="readonly" for="fieldName" expr="eval: __user__.group.code != 'admins'"/> </action-attrs>
Add this on onNew and onLoad of form.
I did that but whether I’m in a user account or an admin account, the form remains editable :’( :
<form title="Contract" name="contract-form"
model="com.axelor.apps.contract.db.Contract" readonlyIf="archived" onLoad="action-readonly">
</form>
<action-attrs name="action-readonly">
<attribute name="readonly" for="fieldName" expr="eval: __user__.group.name != 'Admins'"/>
</action-attrs>
same for :
<action-attrs name="action-readonly">
<attribute name="readonly" for="fieldName" expr="eval: __user__.group.code != 'admins'"/>
</action-attrs>