<openerp>
<data>
- <!-- Read/Unread actions -->
- <record id="actions_server_crm_lead_unread" model="ir.actions.server">
- <field name="name">Mark unread</field>
- <field name="condition">True</field>
- <field name="type">ir.actions.server</field>
- <field name="model_id" ref="model_crm_lead"/>
- <field name="state">code</field>
- <field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
- </record>
- <record id="action_crm_lead_unread" model="ir.values">
- <field name="name">action_crm_lead_unread</field>
- <field name="action_id" ref="actions_server_crm_lead_unread"/>
- <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))"/>
- <field name="key">action</field>
- <field name="model_id" ref="model_crm_lead"/>
- <field name="model">crm.lead</field>
- <field name="key2">client_action_multi</field>
- </record>
-
- <record id="actions_server_crm_lead_read" model="ir.actions.server">
- <field name="name">Mark read</field>
- <field name="condition">True</field>
- <field name="type">ir.actions.server</field>
- <field name="model_id" ref="model_crm_lead"/>
- <field name="state">code</field>
- <field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
- </record>
- <record id="action_crm_lead_read" model="ir.values">
- <field name="name">action_crm_lead_read</field>
- <field name="action_id" ref="actions_server_crm_lead_read"/>
- <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))"/>
- <field name="key">action</field>
- <field name="model_id" ref="model_crm_lead"/>
- <field name="model">crm.lead</field>
- <field name="key2">client_action_multi</field>
- </record>
-
<!--
CRM CASE STAGE
-->
states="draft,open,pending" help="Convert to Opportunity" class="oe_highlight"/>
<button name="case_reset" string="Reset" type="object"
states="cancel"/>
- <button name="case_cancel" string="Cancel" type="object"
+ <button name="case_cancel" string="Cancel Case" type="object"
states="draft,open,pending"/>
- <field name="stage_id" widget="statusbar"
+ <field name="stage_id" widget="statusbar" clickable="True"
+ domain="['&', '|', ('case_default', '=', True), ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"
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_phonecall_new)d"
- string="Phone Calls"/>
+ <button string="Schedule/Log Call"
+ name="%(opportunity2phonecall_act)d"
+ type="action"/>
</div>
<div class="oe_title">
- <label for="name" class="oe_edit_only" string="Lead Description"/>
+ <label for="name" class="oe_edit_only"/>
<h1><field name="name" placeholder="Describe the lead..."/></h1>
</div>
<group>
<field name="partner_id" string="Customer"
on_change="on_change_partner(partner_id)"
options='{"create_name_field": "name"}'
- context="{'name': contact_name, 'street': street, 'city': city, 'state_id': state_id, 'zip': zip, 'country_id': country_id, 'function': function, 'phone': phone, 'mobile': mobile, 'fax': fax, 'email': email, 'user_id': user_id, 'section_id': section_id}"/>
+ context="{'default_name': contact_name, 'default_street': street, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_function': function, 'default_phone': phone, 'default_mobile': mobile, 'default_fax': fax, 'default_email': email_from, 'default_user_id': user_id, 'default_section_id': section_id}"/>
<label for="street" string="Address"/>
<div>
<field name="street" placeholder="Street..."/>
<label for="section_id"/>
<div>
<field name="section_id"/>
- <button name="case_escalate" string="Escalate" type="object" states="draft,open,pending"/>
+ <button name="case_escalate" string="Escalate" type="object" attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
</div>
<field name="type" invisible="1"/>
</group>
<field name="priority"/>
<field name="categ_ids"
widget="many2many_tags"
- domain="[('object_id.model','=','crm.lead')]"/>
+ domain="[('object_id.model','=','crm.lead')]"
+ context="{'object_name': 'crm.lead'}"
+ />
</group>
</group>
<notebook colspan="4">
- <page string="Notes">
+ <page string="Internal Notes">
<field name="description"/>
</page>
<page string="Extra Info">
<group>
- <group string="Categorization">
+ <group string="Categorization" groups="base.group_multi_company,base.group_no_one" name="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_out"/>
</group>
+ <group string="Misc">
+ <field name="active"/>
+ <field name="referred"/>
+ </group>
</group>
</page>
</notebook>
</field>
</record>
-
<!-- CRM Lead Tree View -->
<record model="ir.ui.view" id="crm_case_tree_view_leads">
<field name="name">Leads</field>
<field name="arch" type="xml">
<tree string="Leads" fonts="bold:message_unread==True" colors="grey:state in ('cancel', 'done')">
<field name="date_deadline" invisible="1"/>
- <field name="create_date" groups="base.group_no_one"/>
+ <field name="create_date"/>
<field name="name"/>
<field name="contact_name"/>
<field name="country_id" invisible="context.get('invisible_country', True)"/>
<field name="phone"/>
<field name="stage_id"/>
<field name="user_id" invisible="1"/>
+ <field name="partner_id" invisible="1"/>
<field name="section_id" invisible="context.get('invisible_section', True)"/>
<field name="state" invisible="1"/>
<field name="type_id" invisible="1"/>
</field>
</record>
+
<!-- CRM Lead Calendar View -->
<record model="ir.ui.view" id="crm_case_calendar_view_leads">
<field name="name">CRM - Leads Calendar</field>
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<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="%(opportunity2phonecall_act)d" type="action">Schedule/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>
<b><field name="name"/></b>
<t t-if="record.planned_revenue.raw_value">
- - <b><t t-esc="Math.round(record.planned_revenue.value)"/>
+ - <b><t t-esc="record.planned_revenue.value"/>
<field name="company_currency"/></b>
</t>
</div>
<div class="oe_kanban_bottom_right">
<a t-if="record.priority.raw_value == 1" type="object" name="set_normal_priority" class="oe_e oe_star_on">7</a>
<a t-if="record.priority.raw_value != 1" type="object" name="set_high_priority" class="oe_e oe_star_off">7</a>
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar" t-if="record.user_id.value"/>
</div>
<div class="oe_kanban_footer_left">
<t t-raw="record.message_summary.raw_value"/>
<search string="Search Leads">
<field name="name" string="Lead / Customer" filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
<field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/>
- <field name="create_date"/>
- <filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
- <separator/>
- <filter icon="terp-check" string="New" name="new" help="New Leads" domain="[('state','=','draft')]"/>
- <filter icon="terp-camera_test" string="In Progress" name="open" domain="[('state','=','open')]"/>
- <separator/>
- <filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads"/>
- <separator/>
- <filter string="Leads Assigned to Me or My Team(s)" icon="terp-personal+" context="{'invisible_section': False}"
- domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
- help="Leads that are assigned to one of the sale teams I manage, or to me"/>
+ <field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/>
<field name="user_id"/>
- <field name="section_id" context="{'invisible_section': False}"/>
+ <field name="partner_id"/>
+ <field name="create_date"/>
<field name="country_id" context="{'invisible_country': False}"/>
+ <separator/>
+ <filter string="Open" name="open" domain="[('state','!=','cancel')]" help="Open Leads"/>
+ <filter string="Dead" name="dead" domain="[('state','=','cancel')]"/>
+ <filter string="Unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
+ <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
+ <filter string="Assigned to Me"
+ domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
+ help="Leads that are assigned to me"/>
+ <filter string="Assigned to My Team(s)"
+ domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
+ help="Leads that are assigned to any sales teams I am member of"/>
+ <separator />
+ <filter string="Available for mass mailing"
+ name='not_opt_out' domain="[('opt_out', '=', False)]"
+ help="Leads that did not ask not to be included in mass mailing campaigns"/>
+ <separator />
<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'}"/>
- <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="Creation" help="Create date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
+ <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
+ <filter string="Team" domain="[]" context="{'group_by':'section_id'}"/>
+ <filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
+ <filter string="Customer" help="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
+ <filter string="Country" domain="[]" context="{'group_by':'country_id'}"/>
+ <filter string="Referrer" domain="[]" context="{'group_by':'referred'}"/>
+ <filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
+ <filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
+ <filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
</group>
<group string="Display">
- <filter string="Show Countries" icon="terp-personal+" context="{'invisible_country': False}" help="Show Countries"/>
- <filter string="Show Sales Team" icon="terp-personal+" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
+ <filter string="Show Countries" context="{'invisible_country': False}" help="Show Countries"/>
+ <filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
</group>
- </search>
+ </search>
</field>
</record>
<button string="Meeting"
name="action_makeMeeting"
type="object"
- context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"
- />
+ context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/>
</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_inline" groups="base.group_multi_currency"/> at
- <field name="probability" class="oe_inline" widget="integer"/>%% success rate
+ <field name="company_currency" invisible="1"/>
+ <field name="planned_revenue" class="oe_inline" widget='monetary' options="{'currency_field': 'company_currency'}"/>
+ <span class="oe_grey"> at </span>
+ <field name="probability" class="oe_inline" widget="integer"/>%%
</h2>
</div>
<group>
</group>
<group>
- <field name="user_id"/>
+ <field name="user_id" on_change="on_change_user(user_id)"/>
<label for="section_id"/>
<div>
<field name="section_id" widget="selection"/>
- <button name="case_escalate" string="Escalate" type="object" states="draft,open,pending"/>
+ <button name="case_escalate" string="Escalate" type="object" class="oe_link" attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
</div>
</group>
<group>
<field name="categ_ids"
string="Categories" widget="many2many_tags"
+ context = "{'object_name': 'crm.lead'}"
domain="[('object_id.model', '=', 'crm.lead')]"/>
</group>
<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">
+ <group string="Mailings" name="mailings">
<field name="opt_out"/>
</group>
<group string="Misc">
<field name="arch" type="xml">
<tree string="Opportunities" fonts="bold:message_unread==True" colors="gray:state in ('cancel', 'done');red:date_deadline and (date_deadline < current_date)">
<field name="date_deadline" invisible="1"/>
- <field name="create_date" groups="base.group_no_one"/>
+ <field name="create_date"/>
<field name="name" string="Opportunity"/>
<field name="partner_id" string="Customer"/>
<field name="country_id" invisible="context.get('invisible_country', True)"/>
<field name="type_id" invisible="1"/>
<field name="stage_id"/>
<field name="planned_revenue" sum="Expected Revenues"/>
- <field name="probability" widget="progressbar" avg="Avg. of Probability"/>
+ <field name="probability" avg="Avg. of Probability"/>
<field name="section_id" invisible="context.get('invisible_section', True)"/>
<field name="user_id"/>
+ <field name="referred" invisible="1"/>
<field name="priority" invisible="1"/>
- <field name="state" groups="base.group_no_one"/>
<field name="message_unread" invisible="1"/>
+ <field name="state" invisible="1"/>
</tree>
</field>
</record>
<field name="model">crm.lead</field>
<field name="arch" type="xml">
<search string="Search Opportunities">
- <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="name" string="Opportunity" filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
<field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/>
- <filter icon="terp-mail-message-new" string="Unread Messages" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
- <separator/>
- <filter icon="terp-check" string="New" help="New Opportunities" name="new" domain="[('state','=','draft')]"/>
- <filter icon="terp-camera_test" string="In Progress" help="Open Opportunities" name="open" domain="[('state','=','open')]"/>
- <separator/>
- <filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities"/>
- <separator/>
- <filter string="Opportunities Assigned to Me or My Team(s)" icon="terp-personal+"
- domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
- help="Opportunities that are assigned to either me or one of the sale teams I manage"/>
- <field name="user_id"/>
<field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/>
+ <field name="user_id"/>
<field name="partner_id"/>
+ <separator/>
+ <filter string="New" name="new" domain="[('state','=','draft')]" help="New Opportunities"/>
+ <filter string="In Progress" name="open" domain="[('state','=','open')]" help="Open Opportunities"/>
+ <filter string="Won" name="won" domain="[('state','=','done')]"/>
+ <filter string="Lost" name="lost" domain="[('state','=','cancel')]"/>
+ <filter string="Unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
+ <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
+ <filter string="Assigned to Me"
+ domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
+ help="Opportunities that are assigned to me"/>
+ <filter string="Assigned to My Team(s)"
+ domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
+ help="Opportunities that are assigned to any sales teams I am member of"/>
+ <separator/>
<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'}"/>
- <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="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="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'}"/>
+ <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
+ <filter string="Team" domain="[]" context="{'group_by':'section_id'}"/>
+ <filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
+ <filter string="Customer" help="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
+ <filter string="Country" domain="[]" context="{'group_by':'country_id'}"/>
+ <filter string="Priority" domain="[]" context="{'group_by':'priority'}"/>
+ <filter string="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}"/>
+ <filter string="Referrer" domain="[]" context="{'group_by':'referred'}"/>
+ <filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
+ <filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
+ <filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
</group>
<group string="Display">
- <filter string="Show Sales Team" icon="terp-personal+" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
+ <filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
+ <filter string="Show Countries" context="{'invisible_country': False}" help="Show Countries"/>
</group>
</search>
</field>