This type of action is capable of setting default values or modify the contents of a field.
The syntax is:
<action-record
name="actionName"
model="actionModel"
copy="true|false"
ref="actionRef"
search="actionSearch"
>
<field ... [1..*]/>
</action-record>
Example :
<action-record name="default-orderline-record" entity="com.axelor.sale.db.OrderLine">
<field name="product" expr="action:default-product-record"/>
<field name="price" expr="eval: (100.0 + someField)/anotherField" if="someField != null && anotherField > 0"/>
<field name="quantity" expr="1"/>
<field name="taxes" expr="action:default-tax-record"/>
</action-record>
or
<action-record name="default-tax-record" entity="com.axelor.sale.db.Tax"
search="('self.code LIKE ?1', 'VAT%')">
<field name="code" expr="VAT12"/>
<field name="name" expr="Vat 12%"/>
<field name="rate" expr="0.12"/>
</action-record>
A record action contains an expression for each field and possibly a test with the attribute if .
The second example is a special case. The attribute search search an existing record. If there is then the action is executed, otherwise, a new record is created.