odoo/addons/crm/crm_lead_view.xml

616 lines
34 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<openerp>
<data>
<!--
CRM CASE STAGE
-->
<!-- Stage Search view -->
<record id="crm_lead_stage_search" model="ir.ui.view">
<field name="name">Stage - Search</field>
<field name="model">crm.case.stage</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Stage Search">
<field name="name"/>
<field name="state"/>
<field name="type"/>
</search>
</field>
</record>
<!-- Stage Form view -->
<record id="crm_lead_stage_act" model="ir.actions.act_window">
<field name="name">Stages</field>
<field name="res_model">crm.case.stage</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm.crm_case_stage_tree"/>
<field name="help">Add specific stages to leads and opportunities allowing your sales to better organise their sales pipeline. Stages will allow them to easily track how a specific lead or opportunity is positioned in the sales cycle.</field>
</record>
<menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" name="Stages" sequence="0" parent="base.menu_crm_config_lead" />
<!--
LEADS/OPPORTUNITIES CATEGORIES
-->
<!-- Categories Form View -->
<record id="crm_lead_categ_action" model="ir.actions.act_window">
<field name="name">Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_categ_tree-view"/>
<field name="context" eval="{'object_id': ref('model_crm_lead')}"/>
<field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
<field name="help">Create specific categories that fit your company's activities to better classify and analyse your leads and opportunities. Such categories could for instance reflect your product structure or the different types of sales you do.</field>
</record>
<menuitem action="crm_lead_categ_action"
id="menu_crm_lead_categ" name="Categories"
parent="base.menu_crm_config_lead" sequence="1" groups="base.group_no_one"/>
<!--
LEADS
-->
<!-- CRM Lead Form View -->
<record model="ir.ui.view" id="crm_case_form_view_leads">
<field name="name">CRM - Leads Form</field>
<field name="model">crm.lead</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Leads Form" layout="manual">
<div class="oe_form_topbar">
<button name="%(crm.action_crm_lead2opportunity_partner)d" string="Convert to Opportunity" type="action"
states="draft,open,pending" help="Convert to Opportunity"/>
<button name="case_escalate" string="Escalate" type="object"
states="draft,open,pending"/>
<button name="case_reset" string="Reset" type="object"
states="cancel"/>
<button name="case_cancel" string="Cancel" type="object"
states="draft,open,pending"/>
<div class="oe_right">
<field name="stage_id" nolabel="1" widget="statusbar"
on_change="onchange_stage_id(stage_id)"/>
</div>
<div class="oe_clear"/>
</div>
<sheet layout="auto">
<group colspan="4" col="7">
<field name="name" required="1" string="Subject"/>
<field name="priority"/>
<field name="categ_id"
widget="selection"
domain="[('object_id.model','=','crm.lead')]"/>
<newline />
<field name="user_id" />
<field name="section_id" widget="selection" />
<field name="type" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Lead">
<group colspan="4" col="2">
<field name="partner_name" string="Company Name" />
</group>
<group colspan="2" col="4">
<separator string="Contact" colspan="4" col="4"/>
<field name="contact_name" colspan="4"/>
<newline/>
<field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
<field name="function" />
<field name="street" colspan="4"/>
<field name="street2" colspan="4"/>
<field name="zip"/>
<field name="city"/>
<field name="country_id"/>
<field name="state_id"/>
</group>
<group colspan="2" col="3">
<separator string="Communication" colspan="4" col="3"/>
<field name="email_from" widget="email"/>
<button string="Mail"
name="%(mail.action_email_compose_message_wizard)d"
icon="terp-mail-message-new" type="action" colspan="1"/>
<newline/>
<field name="phone"/>
<newline/>
<field name="fax"/>
<newline/>
<field name="mobile"/>
<newline/>
<separator string="Links" colspan="4" col="3"/>
<field name="partner_id" string="Customer"/>
<button
name="%(action_crm_lead2partner)d"
icon="terp-partner" type="action"
string="Create"
attrs="{'invisible':[('partner_id','!=',False)]}"/>
</group>
<separator colspan="4" string="Notes"/>
<field name="description" nolabel="1" colspan="4"/>
</page>
<page string="Extra Info">
<group colspan="2" col="2">
<separator string="Categorization" colspan="2" col="2"/>
<field name="company_id"
groups="base.group_multi_company"
widget="selection" colspan="2" />
<field name="type_id" select="1" widget="selection"/>
<field name="channel_id" select="1" widget="selection"/>
<field name="referred"/>
<field name="state" groups="base.group_no_one"/>
</group>
<group colspan="2" col="2">
<separator string="Mailings" colspan="2" col="2"/>
<field name="opt_in" on_change="on_change_opt_in(opt_in)"/>
<field name="opt_out" on_change="on_change_opt_out(opt_out)"/>
</group>
<group colspan="2" col="2" groups="base.group_no_one">
<separator string="Statistics" colspan="2" col="2"/>
<field name="day_open"/>
<field name="day_close"/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_form_bottom">
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</div>
</form>
</field>
</record>
<!-- CRM Lead Tree View -->
<record model="ir.ui.view" id="crm_case_tree_view_leads">
<field name="name">Leads</field>
<field name="model">crm.lead</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Leads" fonts="bold:needaction_pending==True" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
<field name="needaction_pending" invisible="1"/>
<field name="date_deadline" invisible="1"/>
<field name="create_date" groups="base.group_no_one"/>
<field name="name" string="Subject"/>
<field name="contact_name"/>
<field name="country_id" invisible="context.get('invisible_country', True)" />
<field name="email_from"/>
<field name="phone"/>
<field name="stage_id"/>
<field name="categ_id" invisible="1"/>
<field name="section_id" invisible="context.get('invisible_section', True)" />
<field name="state" groups="base.group_no_one"/>
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
<field name="channel_id" invisible="1"/>
<field name="subjects" invisible="1"/>
</tree>
</field>
</record>
<!-- CRM Lead Calendar View -->
<record model="ir.ui.view" id="crm_case_calendar_view_leads">
<field name="name">CRM - Leads Calendar</field>
<field name="model">crm.lead</field>
<field name="type">calendar</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="Leads Generation"
date_start="date_action" color="user_id">
<field name="name" />
<field name="partner_name" />
</calendar>
</field>
</record>
<!-- CRM Lead Kanban View -->
<record model="ir.ui.view" id="crm_case_kanban_view_leads">
<field name="name">CRM - Leads Kanban</field>
<field name="model">crm.lead</field>
<field name="type">kanban</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id">
<field name="state" groups="base.group_no_one"/>
<field name="color"/>
<field name="priority"/>
<field name="planned_revenue" sum="Expected Revenues"/>
<field name="user_email"/>
<field name="user_id"/>
<field name="partner_address_email"/>
<templates>
<t t-name="lead_details">
<ul class="oe_kanban_tooltip">
<li t-if="record.phone.raw_value"><b>Phone:</b> <field name="phone"/></li>
<li><b>Probability:</b> <field name="probability"/>%%</li>
<li><b>Creation date:</b> <field name="create_date"/></li>
<li t-if="record.date_deadline.raw_value"><b>Date Deadline:</b> <field name="date_deadline"/></li>
</ul>
</t>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card">
<a class="oe_kanban_menuaction oe_i">B</a>
<ul class="oe_kanban_menu">
<li><a type="edit" >Edit...</a></li>
<li><a type="delete">Delete</a></li>
<li><a name="%(mail.action_email_compose_message_wizard)d" type="action">Send New Email</a></li>
<li><a name="%(opportunity2phonecall_act)d" type="action">Log Call</a></li>
<li><a name="action_makeMeeting" type="object">Schedule Meeting</a></li>
<li><a name="%(crm.action_crm_add_note)d" context="{'model': 'crm.lead' }" type="action">Add Internal Note</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
<div class="oe_kanban_content">
<h3>
<field name="partner_id"/>
<t t-if="record.planned_revenue.raw_value">
- <t t-esc="Math.round(record.planned_revenue.value)"/>
<field name="company_currency"/>
</t>
</h3>
<div>
<b> <field name="partner_address_name"/> </b>
</div>
<div>
<field name="name"/>
</div>
<div style="padding-left: 0.5em">
<i>
<t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
<span t-attf-class="#{red || ''}">
<field name="date_action"/>
</span>
<t t-if="record.date_action.raw_value"> : </t>
<field name="title_action"/>
</i>
</div>
<div class="oe_right">
<a t-if="record.priority.raw_value == 1" icon="star-on" type="object" name="set_normal_priority"/>
<a t-if="record.priority.raw_value != 1" icon="star-off" type="object" name="set_high_priority" style="opacity:0.7; filter:alpha(opacity=70);"/>
<!--
<t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())" t-set="red">oe_kaban_status_red</t>
<span t-attf-class="oe_kanban_status #{red}"> </span>
-->
<img t-att-src="kanban_image('res.users', 'avatar', record.user_id.raw_value[0])" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
<div class="oe_kanban_footer_left">
</div>
</div>
<div class="oe_clear"></div>
</div>
<!--
<div class="oe_kanban_right">
<a name="case_mark_lost" string="Mark Lost" states="open,pending" type="object" icon="kanban-stop" />
<a name="case_pending" string="Pending" states="draft,open" type="object" icon="kanban-pause" />
<a name="case_open" string="Open" states="pending" type="object" icon="gtk-media-play" />
<a name="case_mark_won" string="Mark Won" states="open,pending" type="object" icon="kanban-apply" />
</div>
-->
</t>
</templates>
</kanban>
</field>
</record>
<!-- CRM Lead Search View -->
<record id="view_crm_case_leads_filter" model="ir.ui.view">
<field name="name">CRM - Leads Search</field>
<field name="model">crm.lead</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Leads">
<filter icon="terp-check"
string="New"
name="new" help="New Leads"
domain="[('state','=','draft')]"/>
<filter icon="terp-camera_test"
string="Open"
name="open"
domain="[('state','=','open')]"/>
<filter icon="terp-gtk-media-pause"
string="Pending"
name="pending"
domain="[('state','=','pending')]"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" string="Today"
domain="[('create_date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','&gt;=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"
help="Todays' Leads" />
<filter icon="terp-go-week" string="7 Days"
help="Leads creating during last 7 days"
domain="[('create_date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),('create_date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d 00:00:00'))]"
/>
<separator orientation="vertical"/>
<field name="name" string="Lead / Customer"
filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
<field name="user_id">
<filter icon="terp-personal-"
domain="[('user_id','=', False)]"
help="Unassigned Leads" />
</field>
<field name="subjects"/>
<field name="section_id" widget="selection"
context="{'invisible_section': False}">
<filter icon="terp-personal+"
context="{'invisible_section': False}"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
help="My Sales Team(s)"/>
<filter icon="terp-personal+"
context="{'invisible_section': False}"
domain="[]"
help="Show Sales Team"/>
</field>
<separator orientation="vertical"/>
<field name="country_id" context="{'invisible_country': False}">
<filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
</field>
<newline/>
<group expand="0" string="Group By...">
<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
<separator orientation="vertical"/>
<filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
<filter string="Campaign" icon="terp-gtk-jump-to-rtl"
domain="[]" context="{'group_by':'type_id'}" />
<filter string="Channel" icon="terp-call-start"
domain="[]" context="{'group_by':'channel_id'}" />
<separator orientation="vertical"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical" groups="base.group_no_one"/>
<filter string="Creation" help="Create date" icon="terp-go-month"
domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
</group>
</search>
</field>
</record>
<!--
OPPORTUNITY
-->
<!-- Opportunities Form View -->
<record model="ir.ui.view" id="crm_case_form_view_oppor">
<field name="name">Opportunities</field>
<field name="model">crm.lead</field>
<field name="type">form</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<form string="Opportunities" layout="manual">
<div class="oe_form_topbar oe_form_topbar_hifirst">
<button name="case_open" string="Open" type="object"
states="draft"/>
<button name="case_mark_won" string="Mark Won" type="object"
states="draft,open"/>
<button name="case_mark_lost" string="Mark Lost" type="object"
states="draft,open"/>
<button name="case_reset" string="Reset to Draft" type="object"
states="cancel"/>
<button name="case_escalate" string="Escalate" type="object"
states="open"/>
<button name="stage_previous" string="Previous" type="object"
states="open" icon="gtk-go-back" context="{'stage_type': 'opportunity'}"/>
<button name="stage_next" string="Next" type="object"
states="open" icon="gtk-go-forward" context="{'stage_type': 'opportunity'}"/>
<div class="oe_right">
<field name="stage_id" nolabel="1" widget="statusbar"
on_change="onchange_stage_id(stage_id)"/>
</div>
<div class="oe_clear"/>
</div>
<sheet layout="auto">
<group colspan="4" col="2" width="auto">
<field name="name" required="1" nolabel="1" class="oe_form_title"/>
<div class="oe_text_right">
<button string="Schedule/Log Call"
name="%(opportunity2phonecall_act)d" icon="terp-call-start"
type="action"/>
<button string="Schedule Meeting" icon="gtk-redo"
name="action_makeMeeting"
type="object"/>
</div>
</group>
<group colspan="4" col="4" class="oe_form_group_label_border" style="margin-top: 20px;">
<field name="user_id"/>
<field name="planned_revenue"/>
<field name="date_action"/>
<field name="date_deadline"/>
<field name="title_action"/>
<field name="probability"/>
<field name="type" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Opportunity">
<group col="4" colspan="2">
<separator colspan="4" string="Contacts"/>
<group colspan="2" col="3" class="oe_form_group_label_border">
<field width="80%%" name="partner_id" select="1"
on_change="onchange_partner_id(partner_id, email_from)" string="Customer"/>
<button name="%(action_crm_lead2partner)d"
icon="terp-partner" type="action"
string="Create"
attrs="{'invisible':[('partner_id','!=',False)]}"/>
<field name="phone" colspan="3"/>
<field width="80%%" name="email_from" string="Email"/>
<button string="Mail"
name="%(mail.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.lead'}"
icon="terp-mail-message-new" type="action" />
</group>
</group>
<group col="2" colspan="2" class="oe_form_group_label_border">
<separator colspan="2" string="Category"/>
<field name="section_id" colspan="1" widget="selection"/>
<field name="categ_id" select="1"
string="Category" widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
<field name="state"/>
<field name="priority"/>
</group>
<separator colspan="4" string="Details"/>
<field name="description" nolabel="1" colspan="4"/>
</page>
<page string="Lead">
<separator string="Contact" colspan="4"/>
<group colspan="4" col="4" class="oe_form_group_label_border">
<field name="partner_name" string="Customer Name" colspan="4"/>
</group>
<group colspan="2" col="2" class="oe_form_group_label_border">
<field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
<field name="fax"/>
<field name="street"/>
<field name="zip"/>
<field name="country_id"/>
</group>
<group colspan="2" col="2" class="oe_form_group_label_border">
<field name="function" />
<field name="mobile"/>
<field name="street2"/>
<field name="city"/>
<field name="state_id"/>
</group>
<group colspan="2" col="2" class="oe_form_group_label_border">
<separator string="Categorization" colspan="2"/>
<field name="type_id" widget="selection"/>
<field name="channel_id" widget="selection"/>
</group>
<group colspan="2" col="2" class="oe_form_group_label_border">
<separator string="Mailings" colspan="2"/>
<field name="opt_in" on_change="on_change_opt_in(opt_in)"/>
<field name="opt_out" on_change="on_change_opt_out(opt_out)"/>
</group>
</page>
<page string="Extra Info">
<group col="2" colspan="2" class="oe_form_group_label_border">
<separator string="Misc" colspan="2"/>
<field name="active"/>
<field name="day_open" groups="base.group_no_one"/>
<field name="day_close" groups="base.group_no_one"/>
<field name="referred"/>
</group>
<group col="2" colspan="2" class="oe_form_group_label_border">
<separator colspan="4" string="References"/>
<field name="ref"/>
<field name="ref2"/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_form_bottom">
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</div>
</form>
</field>
</record>
<!-- Opportunities Tree View -->
<record model="ir.ui.view" id="crm_case_tree_view_oppor">
<field name="name">Opportunities Tree</field>
<field name="model">crm.lead</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Opportunities" fonts="bold:needaction_pending==True" colors="blue:state=='pending' and not(date_deadline and (date_deadline &lt; current_date));gray:state in ('cancel', 'done');red:date_deadline and (date_deadline &lt; current_date)">
<field name="needaction_pending" invisible="1"/>
<field name="date_deadline" invisible="1"/>
<field name="create_date" groups="base.group_no_one"/>
<field name="name" string="Opportunity"/>
<field name="partner_id" string="Customer"/>
<field name="country_id" invisible="context.get('invisible_country', True)" />
<field name="date_action"/>
<field name="title_action" />
<field name="channel_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="subjects" invisible="1"/>
<field name="stage_id"/>
<field name="planned_revenue" sum="Expected Revenues"/>
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
<field name="section_id" invisible="context.get('invisible_section', True)" />
<field name="user_id"/>
<field name="priority" invisible="1"/>
<field name="categ_id" invisible="1"/>
<field name="state" groups="base.group_no_one"/>
</tree>
</field>
</record>
<!-- Opportunities Search View -->
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
<field name="name">CRM - Opportunities Search</field>
<field name="model">crm.lead</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Opportunities">
<filter icon="terp-check"
string="New" help="New Opportunities"
name="new"
domain="[('state','=','draft')]"/>
<filter icon="terp-camera_test"
string="Open" help="Open Opportunities"
name="open"
domain="[('state','=','open')]"/>
<filter icon="terp-gtk-media-pause"
string="Pending" help="Pending Opportunities"
name="pending"
domain="[('state','=','pending')]"/>
<separator orientation="vertical"/>
<field name="name" string="Opportunity / Customer"
filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
<field name="user_id">
<filter icon="terp-personal-"
domain="[('user_id','=', False)]"
help="Unassigned Opportunities" />
</field>
<field name="section_id"
context="{'invisible_section': False, 'default_section_id': self}">
<filter icon="terp-personal+"
domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
context="{'invisible_section': False}"
help="My Sales Team(s)" />
<filter icon="terp-personal+"
context="{'invisible_section': False}"
domain="[]"
help="Show Sales Team"/>
</field>
<newline/>
<group expand="0" string="Group By..." colspan="16">
<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
<filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
<filter string="Customer" help="Partner" icon="terp-personal+" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical" />
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
<filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}" />
<filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
<filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical" />
<filter string="Creation" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
<filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}" />
</group>
</search>
</field>
</record>
<!-- crm.lead Opportunities Graph View -->
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
<field name="name">CRM - Opportunity Graph</field>
<field name="model">crm.lead</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="planned_revenue" operator="+"/>
<field name="state" group="True"/>
</graph>
</field>
</record>
</data>
</openerp>