Files
enterprise-addons/crm_helpdesk/views/crm_lead_views.xml
T

38 lines
1.8 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- inherit view of Lead Form : adding the "convert to ticket" button -->
<record id="crm_lead_view_form" model="ir.ui.view">
<field name="name">crm.lead.form</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_form" />
<field name="arch" type="xml">
<xpath expr="/form/header/button[last()]" position="after">
<button class="oe_stat_button" type="action" name="%(crm_lead_convert2ticket_action)d"
string="Convert to Ticket"
invisible="context.get('show_create_ticket', False) or not active or type == 'opportunity'"/>
</xpath>
</field>
</record>
<record id="helpdesk_ticket_view_form_inherited" model="ir.ui.view">
<field name="name">helpdesk.ticket.form.inherited</field>
<field name="model">helpdesk.ticket</field>
<field name="priority">100</field>
<field name="inherit_id" ref="helpdesk.helpdesk_ticket_view_form" />
<field name="arch" type="xml">
<xpath expr="header" position="inside">
<button class="btn btn-secondary" type="object" string="Convert to Lead"
name="action_convert_ticket_to_lead_or_opportunity"
invisible="not active"
groups="crm.group_use_lead" data-hotkey="q"/>
<button class="btn btn-secondary" type="object" string="Convert to Opportunity"
name="action_convert_ticket_to_lead_or_opportunity"
invisible="not active"
groups="!crm.group_use_lead" data-hotkey="q"/>
</xpath>
</field>
</record>
</odoo>