Remove Action(More) Button in odoo?

4.1k views Asked by At

Hello everyone i want to Remove Action button from odoo-10, which is appear in top of the page beside the print. In odoo-7 and odoo-10 it known as More.

I have try below code but it not didn't work. This code hide Action Button from all pages.

def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
    ir_ids = self.pool.get("ir.values").search(cr, user, [('name', '=', 'more_action_id')])
    if context:
        if context.get('pass_any_value_in_context_of action') is True:
            if ir_ids:
                cr.execute("update ir_values set key2 ='client_action_multi' where id in % s", (tuple(ir_ids),))
            if ir_ids:
                cr.execute("update ir_values set key2 = where id in % s", (tuple(ir_ids),))

    return super(product_supplierinfo, self).fields_view_get(cr, user, view_id, view_type, context, toolbar, submenu)
1

There are 1 answers

0
Tihomir Tashev On

To remove an action button you have to do this in your view.xml of your module

Example:

 <record model="ir.ui.view" id="my_saleorder_form">
              <field name="name">my.saleorder.form</field>
              <field name="model">sale.order</field>
              <field name="type">form</field>
              <field name="inherit_id" ref="sale.view_order_form" />
              <field name="arch" type="xml" >
    <xpath expr="//button[@name='action_cancel']" position="replace">

    </xpath>
    </field>

   </record>