【问题标题】:Hide or remove inherited button Odoo隐藏或移除继承按钮 Odoo
【发布时间】:2018-01-15 14:59:00
【问题描述】:

我想隐藏机会视图上的 2 个按钮:'Create Quotation' & 'Convert to Quotation' 这 2 个按钮是使用来自 sale_crm(默认 odoo 模块)模块的 xpath 创建的,未直接在机会表单视图上实现..

这是 sale_crm 模块中的代码

<xpath expr="//field[@name='stage_id']" position="before">
  <button attrs="{'invisible': [('probability', '&lt;', 100)]}" 
         string="Create Quotation" name="618" type="action"/>
  <button attrs="{'invisible': [('probability', '=', 100)]}" 
         string="Convert to Quotation" name="618" type="action" 
         class="oe_highlight"/>
</xpath>

如何从我的自定义模块中隐藏它们

【问题讨论】:

  • 您使用的是哪个版本的 Odoo?

标签: python inheritance xpath odoo-8 odoo


【解决方案1】:

我知道它是第 8 版,所以:

<record model="ir.ui.view" id="crm_case_form_view_oppor_inherit">
<field name="name">CRM - Opportunities - Quote Second Inherit</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="sale_crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
    <data>
        <xpath expr="//field[@string='Create Quotation']" position="attributes">
            <attribute name="invisible">True</attribute>
        </xpath>
        <xpath expr="//field[@string='Convert to Quotation']" position="attributes">
            <attribute name="invisible">True</attribute>
        </xpath>
    </data>
</field>

您可以尝试使用它。希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多