diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 4a792abc9ee..46ce37f188c 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -80,6 +80,8 @@ Dashboard for CRM will include: 'crm_lead_view.xml', 'crm_lead_menu.xml', + 'crm_salesteams.xml', + 'crm_meeting_menu.xml', 'crm_phonecall_view.xml', @@ -113,6 +115,7 @@ Dashboard for CRM will include: 'test/ui/duplicate_lead.yml', 'test/ui/delete_lead.yml', ], + 'css': ['static/src/css/crm.css'], 'installable': True, 'application': True, 'auto_install': False, diff --git a/addons/crm/crm.py b/addons/crm/crm.py index df6d5e12b66..9fa6b6281f7 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -109,6 +109,20 @@ class crm_case_section(osv.osv): def get_full_name(self, cr, uid, ids, field_name, arg, context=None): return dict(self.name_get(cr, uid, ids, context=context)) + def get_number_leads(self, cr, uid, section_ids, field_name, arg, context=None): + res = dict.fromkeys(section_ids, 0) + lead_obj = self.pool.get('crm.lead') + for section_id in section_ids: + res[section_id] = lead_obj.search(cr, uid, [("section_id", "=", section_id), '|', '|', ("type", "=", "lead"), ("type", "=", "both"), ("type", "=", False), ('state', 'not in', ['done', 'cancel'])], count=True, context=context) + return res + + def get_number_opportunities(self, cr, uid, section_ids, field_name, arg, context=None): + res = dict.fromkeys(section_ids, 0) + lead_obj = self.pool.get('crm.lead') + for section_id in section_ids: + res[section_id] = lead_obj.search(cr, uid, [("section_id", "=", section_id), '|', ("type", "=", "opportunity"), ("type", "=", "both"), ('state', 'not in', ['done', 'cancel'])], context=context, count=True) + return res + _columns = { 'name': fields.char('Sales Team', size=64, required=True, translate=True), 'complete_name': fields.function(get_full_name, type='char', size=256, readonly=True, store=True), @@ -128,6 +142,8 @@ class crm_case_section(osv.osv): 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True, help="The email address associated with this team. New emails received will automatically " "create new leads assigned to the team."), + 'number_lead': fields.function(get_number_leads, type='integer', readonly=True), + 'number_opportunity': fields.function(get_number_opportunities, type='integer', readonly=True), } def _get_stage_common(self, cr, uid, context): diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index bb590f49d73..d516b209864 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -45,6 +45,7 @@ Won + done diff --git a/addons/crm/crm_salesteams.xml b/addons/crm/crm_salesteams.xml new file mode 100644 index 00000000000..5bed5606b72 --- /dev/null +++ b/addons/crm/crm_salesteams.xml @@ -0,0 +1,151 @@ + + + + + + + + Leads + crm.lead + tree,form + ['|', ('type','=','lead'), ('type','=',False)] + { + 'search_default_section_id': [active_id], + 'default_section_id': active_id, + 'search_default_new': True, + 'search_default_open': True + } + +

+ Click to create a new lead. +

+ Use leads if you need a qualification step before creating an + opportunity or a customer. It can be a business card you received, + a contact form filled in your website, or a file of unqualified + prospects you import, etc. +

+ Once qualified, the lead can be converted into a business + opportunity and/or a new customer in your address book. +

+
+
+ + + + + Leads + crm.lead + kanban,tree,form + [('type','=','opportunity')] + + { + 'search_default_section_id': [active_id], + 'default_section_id': active_id, + 'search_default_new': True, + 'search_default_open': True + } + +

+ Click to create a new lead. +

+ Use leads if you need a qualification step before creating an + opportunity or a customer. It can be a business card you received, + a contact form filled in your website, or a file of unqualified + prospects you import, etc. +

+ Once qualified, the lead can be converted into a business + opportunity and/or a new customer in your address book. +

+
+
+ + + + + crm.case.section.kanban + crm.case.section + + + + + + + + + + + +
+
+ í + +
+
+

+ +
+ + () +
+
+
+

+ +
+ + + +
+
+ + + +
+
+
+
+
+
+
+ + + + + Sales Teams + crm.case.section + form + kanban,tree,form + + +

+ Click to define a new sales team. +

+ Use sales team to organize your different salespersons or + departments into separate teams. Each team will work in + its own list of opportunities. +

+
+
+ + +
+
\ No newline at end of file diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index 2c156ca2ac2..23d71ef51d4 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -77,56 +77,58 @@ crm.case.section
- + - - - - - - - - - - - - - - - -