odoo/addons/crm/crm_lead_view.xml

635 lines
34 KiB
XML

<?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
-->
<act_window
id="act_crm_opportunity_crm_phonecall_new"
name="Phone calls"
groups="base.group_sale_salesman"
res_model="crm.phonecall"
view_mode="tree,calendar,form"
context="{'default_duration': 1.0 ,'default_opportunity_id': active_id,'default_partner_phone':phone}"
domain="[('opportunity_id', '=', active_id)]"
view_type="form"/>
<act_window
id="act_crm_opportunity_crm_meeting_new"
name="Meetings"
res_model="crm.meeting"
view_mode="tree,form,calendar"
context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
domain="[('opportunity_id', '=', active_id)]"
view_type="form"/>
<!-- 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" version="7.0">
<header>
<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"/>
<field name="stage_id" widget="statusbar"
on_change="onchange_stage_id(stage_id)"/>
</header>
<sheet>
<div class="oe_right oe_button_box" name="buttons">
<button type="action"
name="%(act_crm_opportunity_crm_meeting_new)d"
string="Meetings" />
<button type="action"
name="%(act_crm_opportunity_crm_phonecall_new)d"
string="Phone Calls" />
</div>
<label for="name" class="oe_edit_only" string="Lead Description"/>
<h1><field name="name" placeholder="Describe the lead..."/></h1>
<group>
<group>
<field name="user_id" />
<field name="section_id" widget="selection" />
<field name="type" invisible="1"/>
</group>
<group>
<field name="priority"/>
<field name="categ_id"
widget="selection"
domain="[('object_id.model','=','crm.lead')]"/>
</group>
<group>
<field name="partner_name" string="Company Name"/>
<field name="partner_id" string="Customer"/>
<label for="street" string="Address"/>
<div>
<field name="street" placeholder="Street..."/>
<field name="street2"/>
<div>
<field name="zip" class="oe_inline" placeholder="ZIP"/>
<field name="city" class="oe_inline" placeholder="City"/>
</div>
<field name="state_id" placeholder="State"/>
<field name="country_id" placeholder="Country"/>
</div>
</group>
<group>
<field name="contact_name" />
<field name="email_from" widget="email"/>
<field name="function" />
<field domain="[('domain', '=', 'contact')]" name="title"/>
<field name="phone"/>
<field name="mobile"/>
<field name="fax"/>
<!--
This should be integrated in Open Chatter
<button string="Mail"
name="%(mail.action_email_compose_message_wizard)d"
icon="terp-mail-message-new" type="action" colspan="1"/>
-->
</group>
</group>
<notebook colspan="4">
<page string="Notes">
<field name="description"/>
</page>
<page string="Extra Info">
<group>
<group string="Categorization">
<field name="company_id"
groups="base.group_multi_company"
widget="selection" colspan="2" />
<field name="type_id" widget="selection"/>
<field name="channel_id" widget="selection"/>
<field name="referred"/>
<field name="state" groups="base.group_no_one"/>
</group>
<group string="Mailings">
<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>
</page>
</notebook>
</sheet>
<div class="oe_bottom">
<field name="message_ids" widget="ThreadView"/>
</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"/>
<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 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><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
<div class="oe_kanban_content">
<div>
<b><field name="name"/></b>
<t t-if="record.planned_revenue.raw_value">
- <b><t t-esc="Math.round(record.planned_revenue.value)"/>
<field name="company_currency"/></b>
</t>
</div>
<div>
<field name="partner_id"/>
</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" version="7.0">
<header>
<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'}"/>
<button name="case_mark_won" string="Mark Won" type="object"
states="draft,open,pending"/>
<button name="case_open" string="Open" type="object"
states="draft,pending"/>
<button name="case_escalate" string="Escalate" type="object"
states="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="done,cancel"/>
<button name="case_cancel" string="Cancel" type="object"
states="draft"/>
<field name="stage_id" widget="statusbar"
on_change="onchange_stage_id(stage_id)"/>
</header>
<sheet>
<div class="oe_right oe_button_box">
<button string="Schedule/Log Call"
name="%(opportunity2phonecall_act)d"
type="action"/>
<button string="Schedule Meeting"
name="action_makeMeeting"
type="object"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<label for="planned_revenue" class="oe_edit_only"/>
<h2>
<field name="planned_revenue" class="oe_inline"/>
<field name="company_currency" class="oe_edit_only oe_inline"/> at
<field name="probability" class="oe_inline"/> %% success rate
</h2>
</div>
<group>
<group>
<field name="partner_id"
on_change="onchange_partner_id(partner_id, email_from)"
string="Customer"
context="{'default_name': partner_name, 'default_email': email_from, 'default_phone': phone}"/>
<field name="email_from" string="Email"/>
<field name="phone"/>
</group>
<group>
<label for="title_action"/>
<div>
<field name="date_action" nolabel="1"/> -
<field name="title_action" class="oe_inline" nolabel="1" placeholder="Call for proposal"/>
</div>
<field name="date_deadline"/>
<field name="priority"/>
</group>
<group>
<field name="user_id"/>
<field name="section_id" colspan="1" widget="selection"/>
</group>
<group>
<field name="categ_id"
string="Category" widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
</group>
</group>
<!--<button string="Mail"
name="%(mail.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.lead'}"
icon="terp-mail-message-new" type="action" />-->
<notebook colspan="4">
<page string="Internal Notes">
<field name="description"/>
</page>
<page string="Lead">
<group>
<group>
<field name="partner_name"/>
<label for="street" string="Address"/>
<div>
<field name="street" placeholder="Street..."/>
<field name="street2"/>
<div>
<field name="zip" class="oe_inline" placeholder="ZIP"/>
<field name="city" class="oe_inline" placeholder="City"/>
</div>
<field name="state_id" placeholder="State"/>
<field name="country_id" placeholder="Country"/>
</div>
</group>
<group>
<field name="contact_name" />
<field name="function" />
<field domain="[('domain', '=', 'contact')]" name="title"/>
<field name="mobile"/>
<field name="fax"/>
</group>
<group string="Categorization">
<field name="type_id" widget="selection"/>
<field name="channel_id" widget="selection"/>
</group>
<group string="Mailings">
<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 string="Misc">
<field name="active"/>
<field name="day_open" groups="base.group_no_one"/>
<field name="day_close" groups="base.group_no_one"/>
<field name="referred"/>
<field name="state" groups="base.group_no_one"/>
<field name="type" invisible="1"/>
</group>
<group string="References">
<field name="ref"/>
<field name="ref2"/>
</group>
</group>
</page>
</notebook>
</sheet>
<footer>
<field name="message_ids" widget="ThreadView"/>
</footer>
</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>