Python 隐藏或删除继承的按钮Odoo

Python 隐藏或删除继承的按钮Odoo,python,inheritance,xpath,odoo-8,odoo,Python,Inheritance,Xpath,Odoo 8,Odoo,我想隐藏opportunity视图上的两个按钮:“创建报价单”和“转换为报价单” 这两个按钮是使用xpath从sale_crm(默认odoo模块)模块创建的,而不是直接在opportunity form view上实现 这是销售\u crm模块中的代码 <xpath expr="//field[@name='stage_id']" position="before"> <button attrs="{'invisible': [('probability', '&l

我想隐藏opportunity视图上的两个按钮:“创建报价单”和“转换为报价单” 这两个按钮是使用xpath从sale_crm(默认odoo模块)模块创建的,而不是直接在opportunity form view上实现

这是销售\u 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>


如何在自定义模块中隐藏它们

我发现它是版本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>

CRM-商机-报价第二继承
crm.lead
真的
真的


你可以试着用它。我希望这能对您有所帮助。

我想这是第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>

CRM-商机-报价第二继承
crm.lead
真的
真的


你可以试着用它。我希望这能对您有所帮助。

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