From eb700cf29beb3865e26fb4f8c53469f2cac40eb7 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Tue, 30 Jul 2013 16:38:22 +0530 Subject: [PATCH] [IMP] Added company_id and currency_symbole field and improved related code to show tooltip as per requrement and 5 sec late,improved css to show proper cursore, improved actions & domains for proper results. bzr revid: tpa@tinyerp.com-20130730110822-zzioh92in4azqay8 --- addons/crm/crm.py | 12 ++++- addons/crm/crm_case_section_view.xml | 53 ++++++++++++++++++-- addons/crm/static/src/css/crm.css | 3 +- addons/crm/static/src/js/crm_case_section.js | 5 +- addons/sale_crm/report/sale_report_view.xml | 2 +- addons/sale_crm/sale_crm_view.xml | 8 +-- 6 files changed, 69 insertions(+), 14 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index d1194508b71..876814fe5b7 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -156,6 +156,13 @@ class crm_case_section(osv.osv): res[id]['monthly_planned_revenue'] = self.__get_bar_values(cr, uid, obj, opp_domain, ['planned_revenue', 'create_date'], 'planned_revenue', 'create_date', context=context) return res + def _get_currency_symbol(self, cr, uid, ids, name, arg, context=None): + """Set currency symbole of company currency""" + res = {} + for sales_team in self.browse(cr, uid, ids, context=context): + res[sales_team.id] = sales_team.company_id.currency_id.symbol + 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), @@ -184,7 +191,9 @@ class crm_case_section(osv.osv): string='Open Leads per Month'), 'monthly_planned_revenue': fields.function(_get_opportunities_data, type="string", readonly=True, multi='_get_opportunities_data', - string='Planned Revenue per Month') + string='Planned Revenue per Month'), + 'company_id': fields.many2one('res.company', 'Company', select=1), + 'currency_symbol': fields.function(_get_currency_symbol, string='Currency Symbol', method=True, type='char'), } def _get_stage_common(self, cr, uid, context): @@ -195,6 +204,7 @@ class crm_case_section(osv.osv): 'active': 1, 'stage_ids': _get_stage_common, 'use_leads': True, + 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case.section', context=c), } _sql_constraints = [ diff --git a/addons/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml index c957311b47f..c8d4cb01c41 100644 --- a/addons/crm/crm_case_section_view.xml +++ b/addons/crm/crm_case_section_view.xml @@ -13,7 +13,6 @@ { 'search_default_section_id': [active_id], - 'search_default_open': 1, 'default_section_id': active_id, 'default_type': 'lead', 'stage_type': 'lead', @@ -43,7 +42,6 @@ { 'search_default_section_id': [active_id], - 'search_default_assigned_to_me': 1, 'default_section_id': active_id, 'stage_type': 'opportunity', 'default_type': 'opportunity', @@ -64,6 +62,52 @@ + + Leads Analysis + crm.lead.report + form + {"search_default_month":1} + tree,graph + [('type','=', 'lead'),('section_id', '=', active_id)] + Leads Analysis allows you to check different CRM related information like the treatment delays or number of leads per state. You can sort out your leads analysis by different groups to get accurate grained analysis. + + + + tree + + + + + + graph + + + + + + Opportunities Analysis + crm.lead.report + form + {"search_default_month":1} + tree,graph + [('type','=', 'opportunity'), ('section_id', '=', active_id)] + Opportunities Analysis gives you an instant access to your opportunities with information such as the expected revenue, planned cost, missed deadlines or the number of interactions per opportunity. This report is mainly used by the sales manager in order to do the periodic review with the teams of the sales pipeline. + + + + + tree + + + + + + + graph + + + + @@ -80,6 +124,7 @@ + diff --git a/addons/crm/static/src/css/crm.css b/addons/crm/static/src/css/crm.css index 53939191eb5..680c3a9bd88 100644 --- a/addons/crm/static/src/css/crm.css +++ b/addons/crm/static/src/css/crm.css @@ -1,5 +1,6 @@ .openerp .oe_kanban_view .oe_kanban_crm_salesteams { width: 345px; + cursor: default; } .openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_avatars { text-align: right; @@ -61,5 +62,5 @@ .openerp .oe_kanban_view .oe_sparkline_bar { height: 20px; - width: 36px; + width: 36px !important; } \ No newline at end of file diff --git a/addons/crm/static/src/js/crm_case_section.js b/addons/crm/static/src/js/crm_case_section.js index 2b4ca741d75..f16dc31f634 100644 --- a/addons/crm/static/src/js/crm_case_section.js +++ b/addons/crm/static/src/js/crm_case_section.js @@ -8,7 +8,6 @@ openerp.crm = function(openerp) { } }, }); - openerp.crm.SparklineBarWidget = openerp.web_kanban.AbstractField.extend({ className: "oe_sparkline_bar", start: function() { @@ -20,12 +19,12 @@ openerp.crm = function(openerp) { self.$el.sparkline(value, { type: 'bar', barWidth: 5, - tooltipFormat: '{{offset:offset}} {{value}}', + tooltipFormat: _.str.sprintf("{{offset:offset}}: {{value}} %s",self.$el.closest("div[class='oe_salesteams_leads']").attr('class') ? 'Leads' : self.getParent().record.currency_symbol.raw_value), tooltipValueLookups: { 'offset': tooltips }, }); - self.$el.tipsy({'delayIn': 0, 'html': true, 'title': function(){return title}, 'gravity': 'n'}); + self.$el.tipsy({'delayIn': 3000, 'html': true, 'title': function(){return title}, 'gravity': 'n'}); }, 0); }, }); diff --git a/addons/sale_crm/report/sale_report_view.xml b/addons/sale_crm/report/sale_report_view.xml index f054634cf1c..99ab196a115 100644 --- a/addons/sale_crm/report/sale_report_view.xml +++ b/addons/sale_crm/report/sale_report_view.xml @@ -17,7 +17,7 @@ sale.report - + diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml index 7e0d6b27a3a..667d5f4f412 100644 --- a/addons/sale_crm/sale_crm_view.xml +++ b/addons/sale_crm/sale_crm_view.xml @@ -217,7 +217,7 @@ form tree,graph [('state','=','draft'),('section_id', '=', active_id)] - {'search_default_order_month':1,'search_default_User':1} + {'search_default_order_month':1} This report performs analysis on your quotations. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application. @@ -227,7 +227,7 @@ form tree,graph [('state','not in',('draft','done','cancel')),('section_id', '=', active_id)] - {'search_default_order_month':1,'search_default_User':1} + {'search_default_order_month':1} This report performs analysis on your sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application. @@ -237,7 +237,7 @@ form tree,graph [('section_id', '=', active_id)] - {'search_default_month':1, 'search_default_user':1} + {'search_default_month':1} From this report, you can have an overview of the amount invoiced to your customer. The tool search can also be used to personalise your Invoices reports and so, match this analysis to your needs. @@ -299,7 +299,7 @@
Invoiced - Forecast + Forecast

Define an invoicing target in the sales team settings to see the period's achievement and forecast at a glance.