Axelor Doc

The action attribute

Attribute actions are used to change the attributes of the fields in views such as: title , domain , required , readonly , hidden , collapse etc.

Example:

<action-attrs name="action-sale-order-confirm-attrs">
    <attribute name="title" for="name" expr="eval: String.format('Order No.')" if="confirmed"/>
    <attribute name="title" for="name" expr="Name" if="!confirmed"/>
    <attribute name="required" for="createDate" expr="eval: !confirmed"/>
</action-attrs>

The attribute title of the field name is determined dynamically.

The visibility of some columns in a field relationship O2M like M2M and wording can be specified as follows:

<form name="contact-form">
 ...
    <field name="lastName" onChange="action-contact-address-attrs"/>
 ...
    <field name="addresses"/>
 ...
</form>

And the action:

<action-attrs name="action-contact-address-attrs">
    <attribute name="title" for="addresses.area" expr="Location" if="lastName == null"/>
    <attribute name="title" for="addresses.area" expr="Area" if="lastName != null"/>
    <attribute name="hidden" for="addresses.zip" expr="eval: lastName == null"/>
</action-attrs>

Note the full name with the use of. (Dot) as a separator.