[IMP] imrpved code to remove error of undefined record

bzr revid: tpa@tinyerp.com-20130819054516-je0uzg0jlsap909r
This commit is contained in:
Turkesh Patel (Open ERP) 2013-08-19 11:15:16 +05:30
parent a3508b45d7
commit f76b2078aa
1 changed files with 5 additions and 1 deletions

View File

@ -17,10 +17,14 @@ var _t = openerp.web._t;
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)') : self.getParent().record.currency_symbol.raw_value),
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
},