There are two ways to hide the displayed button.
- Change the state of the object and the display button based on statistics.
eg
<button name="invoice_open" states="draft,proforma2" string="Approve" icon="terp-camera_test"/>
This is an example of account.invoice , where the Approve button will be visible if invoice is in draft or proforma2 .
- You can add
group for viewing, and the button will be displayed only for this groups .
eg
<field name="account_id" groups="account.group_account_user"/>
This is an example account.invoice.line , where the account_id field is shown only to users who belong to account.group_account_user .
Hope this solves your problem.
source share