Hi I'm using odoo 12 I'd like to remove an action button from a form
and also the share inside the action menu:
I did the following in the inherited view without results:
<record model="ir.ui.view" id="sale_order_log_notes">
<field name="name">sale.order.log.notes</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="attributes">
<attribute name="share">0</attribute>
<attribute name="print">0</attribute>
</xpath>
</field>
</record>


The
Quotation / Orderaction was added using the report shortcut toir.action.reportand the Share button was added using a server action.There are already two buttons in the corresponding form views to unlink the actions (as mentioned by
mingtwo_h9), a button namedRemove from the 'print' menuto remove the action from the print dropdown menu andRemove Contextual Actionbutton to remove an action from the dropdown action menu, both buttons call theunlink_actionmethod, which is implemented separately for ir.actions.report and ir.actions.server and when called sets thebinding_model_idfield toFalsewhich hides the action.It is possible to make a call to a method on a model using the function tag.
We need to call the
unlink_actionmethod and pass the action record as a parameterYou can also pass parameters using the
valuetag (there is an example in l10n_generic_coa)