我想隐藏机会视图上的2个按钮:“CreateQu言”&“TransfertoQu言”,这2个按钮是使用sale_crm (默认odoo模块)模块创建的,而不是直接在机会表单视图上实现的。
这是sale_crm模块的代码
<xpath expr="//field[@name='stage_id']" position="before">
<button attrs="{'invisible': [('probability', '<', 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>如何将它们隐藏在自定义模块中?
发布于 2018-01-15 19:54:11
我想这是第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>
你可以试试这个。我希望这对你有帮助。
https://stackoverflow.com/questions/48265480
复制相似问题