Hi,
How can I show or hide a server action button based on a field value in my model?
For example, if the state field is 'closed', I want the "Open" button to be visible.
And if the state is 'open', I want the "Close" button to be displayed instead.
Is there a way to conditionally show or hide these server actions depending on the record's state?
<record id="mymodel_open_action_server" model="ir.actions.server">
<field name="name">Open mymodel</field>
<field name="model_id" ref="model_mymodel"/>
<field name="binding_model_id" ref="model_mymodel"/>
<field name="binding_view_types">form</field>
<field name="state">code</field>
<field name="code">
action = records.open_action()
</field>