0

I want to hide the 2 buttons on opportunity view : 'Create Quotation' & 'Convert to Quotation' These 2 buttons are created using xpath from sale_crm (default odoo module) module not implemented directly on opportunity form view ..

And this is the code from sale_crm module

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

how can I hide them from my custom module

Nebil Aydi
  • 53
  • 7

1 Answers1

2

I figure out it's version 8, so:

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

You could try using that. I hope this can be helpfull for you.

Juan Salcedo
  • 1,598
  • 1
  • 16
  • 28