1 openerp.crm = function(openerp) {
2 var _t = openerp.web._t;
3 openerp.web_kanban.KanbanRecord.include({
4 on_card_clicked: function() {
5 if (this.view.dataset.model === 'crm.case.section') {
6 this.$('.oe_kanban_crm_salesteams_list a').first().click();
8 this._super.apply(this, arguments);
12 openerp.crm.SparklineBarWidget = openerp.web_kanban.AbstractField.extend({
13 className: "oe_sparkline_bar",
16 var title = this.$node.html();
17 setTimeout(function () {
18 var value = _.pluck(self.field.value, 'value');
19 var tooltips = _.pluck(self.field.value, 'tooltip');
20 var currency_symbol = "";
21 if (self.getParent()){
22 currency_symbol = self.getParent().record.currency_symbol.raw_value;
24 self.$el.sparkline(value, {
27 tooltipFormat: _.str.sprintf("{{offset:offset}}: {{value}} %s",self.$el.closest("div[class='oe_salesteams_leads']").attr('class') ? _t('Lead(s)') : currency_symbol),
28 tooltipValueLookups: {
32 self.$el.tipsy({'delayIn': 3000, 'html': true, 'title': function(){return title}, 'gravity': 'n'});
36 openerp.web_kanban.fields_registry.add("sparkline_bar", "openerp.crm.SparklineBarWidget");