3
votes

I want to hide the edit button from the form in my module.But it should hide after changing the status to 'done'.I have three states for record (new,draft,done).If it is in 'draft' status I want to show the edit button . But if it is on 'done' state need to hide the edit button. I tried this

<form string="Consumption Result" edit="false" version="7.0">

But this cause always hide the edit button . How can I give condition here.

1
you can give attrs="{'readonly': [('state','in',('done'))]}" for fieldsPravitha V

1 Answers

0
votes

You can provide states="draft" for the button "edit" like below:

<button name="case_edit" string="Edit" type="object" states="draft"/>

with this definition the button is available when the states="draft" and not available at "new" and "done".