首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在odoo中删除操作(更多)按钮?

在odoo中删除操作(更多)按钮?
EN

Stack Overflow用户
提问于 2016-12-19 16:22:06
回答 1查看 3.9K关注 0票数 0

大家好,我想从odoo-10中删除操作按钮,这是出现在页面顶部旁边的打印。在odoo-7odoo-10中,它被称为More。

我已经尝试了下面的代码,但它不是不起作用。此代码从所有页面隐藏操作按钮。

代码语言:javascript
复制
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)
EN

回答 1

Stack Overflow用户

发布于 2017-03-17 21:54:43

要删除操作按钮,必须在模块的view.xml中执行此操作

示例:

代码语言:javascript
复制
 <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>
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41218412

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档