[ADD] crm: onboarding tour
Also add a simplified form view to create opportunities
This commit is contained in:
committed by
Aaron Bohy
parent
b0610837c3
commit
025dcfcd68
@@ -39,6 +39,7 @@ Dashboard for CRM will include:
|
||||
'fetchmail',
|
||||
'utm',
|
||||
'web_planner',
|
||||
'web_tour',
|
||||
],
|
||||
'data': [
|
||||
'data/crm_action_data.xml',
|
||||
@@ -75,7 +76,8 @@ Dashboard for CRM will include:
|
||||
'views/crm.xml',
|
||||
'web_planner_data.xml',
|
||||
'sales_team_dashboard.xml',
|
||||
'crm_mail_template_data.xml'
|
||||
'crm_mail_template_data.xml',
|
||||
'tour_view.xml'
|
||||
],
|
||||
'demo': [
|
||||
'crm_demo.xml',
|
||||
|
||||
@@ -158,8 +158,13 @@ class crm_lead(FormatAddress, osv.osv):
|
||||
for opp_id in ids
|
||||
}
|
||||
|
||||
def _get_company_currency(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
return self.pool['res.users'].browse(cr, uid, uid, context=context).company_id.currency_id.id
|
||||
|
||||
_columns = {
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange',
|
||||
'partner_id': fields.many2one('res.partner', 'Customer', ondelete='set null', track_visibility='onchange',
|
||||
select=True, help="Linked partner (optional). Usually created when converting the lead."),
|
||||
|
||||
'id': fields.integer('ID', readonly=True),
|
||||
@@ -241,6 +246,7 @@ class crm_lead(FormatAddress, osv.osv):
|
||||
_defaults = {
|
||||
'active': 1,
|
||||
'type': lambda s, cr, uid, c: 'lead' if s.pool['res.users'].has_group(cr, uid, 'crm.group_use_lead') else 'opportunity',
|
||||
'company_currency': _get_company_currency,
|
||||
'user_id': lambda s, cr, uid, c: uid,
|
||||
'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c),
|
||||
'team_id': lambda s, cr, uid, c: s.pool['crm.team']._get_default_team_id(cr, SUPERUSER_ID, context=c, user_id=uid),
|
||||
@@ -1161,6 +1167,8 @@ Update your business card, phone book, social media,... Send an email right now
|
||||
else:
|
||||
raise UserError(_('This target does not exist.'))
|
||||
|
||||
def close_dialog(self, cr, uid, ids, context=None):
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
class crm_lead_tag(osv.Model):
|
||||
_name = "crm.lead.tag"
|
||||
|
||||
@@ -226,12 +226,49 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- CRM Lead Kanban View -->
|
||||
<!-- CRM Lead simplified Form View -->
|
||||
<record id="view_create_opportunity_simplified" model="ir.ui.view">
|
||||
<field name="name">crm.lead.form.simple</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create an Opportunity">
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="name" string="Opportunity Title" placeholder="e.g. Customer Deal"/>
|
||||
<field name="partner_id"/>
|
||||
<label for="planned_revenue"/>
|
||||
<div class="o_row">
|
||||
<field name="planned_revenue"/>
|
||||
<field name="company_currency" options="{'no_create': True, 'no_open': True}"/>
|
||||
</div>
|
||||
<field name="priority" widget="priority"/>
|
||||
</group>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Create" name="close_dialog" type="object" class="btn-primary"/>
|
||||
<button string="Discard" class="btn-default" special="cancel"/>
|
||||
</footer>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="create_opportunity_simplified" model="ir.actions.act_window">
|
||||
<field name="name">Create an Opportunity</field>
|
||||
<field name="res_model">crm.lead</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_create_opportunity_simplified"/>
|
||||
<field name="target">new</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="arch" type="xml">
|
||||
<kanban default_group_by="stage_id" class="o_kanban_small_column">
|
||||
<kanban default_group_by="stage_id" class="o_kanban_small_column o_opportunity_kanban" on_create="crm.create_opportunity_simplified">
|
||||
<field name="stage_id" options='{"group_by_tooltip": {"requirements": "Description", "legend_priority": "Use of stars"}}'/>
|
||||
<field name="color"/>
|
||||
<field name="priority"/>
|
||||
@@ -288,7 +325,6 @@
|
||||
</a>
|
||||
<a name="%(crm.crm_activity_schedule_action)d" type="action" t-if="record.kanban_state.raw_value=='red'">
|
||||
<span
|
||||
title="No 'next activity' scheduled, click to set one."
|
||||
class="oe_kanban_status oe_kanban_status_red"/>
|
||||
</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 pull-right"/>
|
||||
@@ -352,7 +388,7 @@
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="priority">20</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Opportunities">
|
||||
<form string="Opportunities" class="o_opportunity_form">
|
||||
<header>
|
||||
<button name="action_set_won" string="Mark Won"
|
||||
type="object" class="oe_highlight o_wow"
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
odoo.define('crm.tour', function(require) {
|
||||
"use strict";
|
||||
|
||||
var core = require('web.core');
|
||||
var tour = require('web_tour.tour');
|
||||
|
||||
var _t = core._t;
|
||||
|
||||
tour.register('crm_tour', {
|
||||
'skip_enabled': true,
|
||||
}, [{
|
||||
trigger: '.o_app[data-menu-xmlid="sales_team.menu_base_partner"], .oe_menu_toggler[data-menu-xmlid="sales_team.menu_base_partner"]',
|
||||
content: _t("Ready to boost you sales? It starts with the <b>CRM app</b>."),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: ".o_welcome_content .o_dashboard_action",
|
||||
extra_trigger: '.o_sales_dashboard',
|
||||
content: _t("Let\'s have a look at your opportunities pipeline."),
|
||||
position: "bottom"
|
||||
}, {
|
||||
trigger: ".o-kanban-button-new",
|
||||
extra_trigger: '.o_opportunity_kanban',
|
||||
content: _t("Create your first business opportunity."),
|
||||
position: "right"
|
||||
}, {
|
||||
trigger: ".o_opportunity_kanban .o_kanban_record:nth-child(2)",
|
||||
content: _t("<b>Drag & drop opportunities</b> between columns as you progress in your sales cycle."),
|
||||
position: "right"
|
||||
}, {
|
||||
trigger: ".o_kanban_record .oe_kanban_status_red",
|
||||
extra_trigger: ".o_opportunity_kanban",
|
||||
content: _t("This opportunity has <b>no next activity scheduled</b>. <i>Click to set one.</i>"),
|
||||
position: "bottom"
|
||||
}, {
|
||||
trigger: ".o_recommended_activity .o_radio_item:first()",
|
||||
extra_trigger: ".o_opportunity_kanban",
|
||||
content: _t("<p>You will be able to customize your followup activities. Examples:</p><ol><li>introductory email</li><li>call 10 days after</li><li>second call 3 days after, ...</li></ol><p class='mb0'><i>Select a standard activity for now on.</i></p>"),
|
||||
position: "left"
|
||||
}, {
|
||||
trigger: ".o_kanban_record",
|
||||
extra_trigger: ".o_opportunity_kanban",
|
||||
content: _t("Click on an opportunity to zoom to it."),
|
||||
position: "bottom"
|
||||
}, {
|
||||
trigger: ".o_opportunity_form .o_chatter_button_new_message",
|
||||
content: _t('<p><b>Send messages</b> to your prospect and get replies automatically attached to this opportunity.</p><p class="mb0">Type <i>\'@\'</i> to mention people - it\'s like cc-ing on emails.</p>'),
|
||||
position: "top"
|
||||
}, {
|
||||
trigger: ".breadcrumb li:not(.active):last",
|
||||
extra_trigger: '.o_opportunity_form',
|
||||
content: _t("Use the breadcrumbs to <b>go back to your sales pipeline</b>."),
|
||||
position: "bottom"
|
||||
}]);
|
||||
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<!-- Make the xmlid of menus required by the CRM tour available in webclient -->
|
||||
<record id="sales_team.menu_base_partner" model="ir.ui.menu">
|
||||
<field name="load_xmlid" eval="True"/>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
<!-- Salesteam dashboard asset -->
|
||||
<script type="text/javascript" src="/crm/static/src/js/sales_team_dashboard.js"></script>
|
||||
<script type="text/javascript" src="/crm/static/src/js/tour.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<group>
|
||||
<div>
|
||||
<p><strong>Recommended activities:</strong></p>
|
||||
<field name="recommended_activity_id" widget="radio"
|
||||
<field name="recommended_activity_id" widget="radio" class="o_recommended_activity"
|
||||
domain="[('preceding_activity_ids', '=', last_activity_id)]"/>
|
||||
</div>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user