[IMP] imrpved code to remove error of undefined record
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Mon, 19 Aug 2013 05:45:16 +0000 (11:15 +0530)
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>
Mon, 19 Aug 2013 05:45:16 +0000 (11:15 +0530)
bzr revid: tpa@tinyerp.com-20130819054516-je0uzg0jlsap909r

addons/crm/static/src/js/crm_case_section.js

index a281e4b..5c76668 100644 (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
                     },