diff --git a/addons/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml index b5e23fec324..78727b396d3 100644 --- a/addons/crm/crm_case_section_view.xml +++ b/addons/crm/crm_case_section_view.xml @@ -144,11 +144,11 @@
Leads - Open Leads per Month
Click to see a detailed analysis of leads.
+ Open Leads per Month
Click to see a detailed analysis of leads.
Opportunities - Planned Revenue per Month
Click to see a detailed analysis of opportunities.
+ Planned Revenue per Month
Click to see a detailed analysis of opportunities.
diff --git a/addons/crm/static/src/js/crm_case_section.js b/addons/crm/static/src/js/crm_case_section.js index 5c76668849e..83e4205f4e5 100644 --- a/addons/crm/static/src/js/crm_case_section.js +++ b/addons/crm/static/src/js/crm_case_section.js @@ -9,30 +9,17 @@ var _t = openerp.web._t; } }, }); - openerp.crm.SparklineBarWidget = openerp.web_kanban.AbstractField.extend({ - className: "oe_sparkline_bar", - start: function() { - var self = this; - var title = this.$node.html(); - setTimeout(function () { - var value = _.pluck(self.field.value, 'value'); - var tooltips = _.pluck(self.field.value, 'tooltip'); - var currency_symbol = ""; - if (self.getParent()){ - currency_symbol = self.getParent().record.currency_symbol.raw_value; - }; - self.$el.sparkline(value, { - type: 'bar', - barWidth: 5, - tooltipFormat: _.str.sprintf("{{offset:offset}}: {{value}} %s",self.$el.closest("div[class='oe_salesteams_leads']").attr('class') ? _t('Lead(s)') : currency_symbol), - tooltipValueLookups: { - 'offset': tooltips - }, - }); - self.$el.tipsy({'delayIn': 3000, 'html': true, 'title': function(){return title}, 'gravity': 'n'}); - }, 0); - }, - }); - openerp.web_kanban.fields_registry.add("sparkline_bar", "openerp.crm.SparklineBarWidget"); + openerp.web_kanban.SparklineBarWidgetSalesTeam = openerp.web_kanban.SparklineBarWidget.extend({ + set_offset:function(){ + var self = this; + var currency_symbol = ""; + if (self.getParent()){ + currency_symbol = self.getParent().record.currency_symbol.raw_value; + }; + return _.str.sprintf("{{offset:offset}}: {{value}} %s",self.$el.closest("div[class='oe_salesteams_leads']").attr('class') ? _t('Lead(s)') : currency_symbol) + } + }); + +openerp.web_kanban.fields_registry.add("sparkline_bar_sales", "openerp.web_kanban.SparklineBarWidgetSalesTeam"); }; diff --git a/addons/sale_crm/sale_crm_view.xml b/addons/sale_crm/sale_crm_view.xml index c7d3dc42292..c31e87bdf28 100644 --- a/addons/sale_crm/sale_crm_view.xml +++ b/addons/sale_crm/sale_crm_view.xml @@ -272,7 +272,7 @@
Sales Orders - + Revenue of confirmed sales orders per month.
Click to acces the Sales Analysis.
@@ -282,7 +282,7 @@
Invoices - + Revenue of sent invoices per month.
Click to see a detailed analysis of invoices.
@@ -290,7 +290,7 @@