2016-12-19 5 views
0

Привет всем, я хочу удалить кнопку действия от odoo-10, которая отображается в верхней части страницы рядом с отпечатком. В odoo-7 и odoo-10 он известен как More.Удалить действие (больше) Кнопка в оду?

Я попробовал под кодом, но это не сработало. Этот код скрывает Action Button со всех страниц.

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) 
+0

Здравствуйте, вы нашли решение этой проблемы? – enigmq

ответ

0

Чтобы удалить кнопку действия, вы должны сделать это в view.xml вашего модуля

Пример:

<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>