Browse Source

[UPDT] Bug Fix 'crm_dashboard'

pull/213/head
AjmalCybro 3 years ago
parent
commit
51342d0d2d
  1. 2
      crm_dashboard/__manifest__.py
  2. 7
      crm_dashboard/doc/RELEASE_NOTES.md
  3. 14
      crm_dashboard/models/crm_dashboard.py

2
crm_dashboard/__manifest__.py

@ -24,7 +24,7 @@
'description': """CRM Dashboard, Detailed Dashboard View for CRM, CRM, Dashboard, odoo13""", 'description': """CRM Dashboard, Detailed Dashboard View for CRM, CRM, Dashboard, odoo13""",
'summary': """Detailed Dashboard View for CRM""", 'summary': """Detailed Dashboard View for CRM""",
'category': 'Sales', 'category': 'Sales',
'version': '13.0.1.0.2', 'version': '13.0.1.0.3',
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',

7
crm_dashboard/doc/RELEASE_NOTES.md

@ -3,4 +3,9 @@
#### 18.12.2021 #### 18.12.2021
#### Version 13.0.1.0.0 #### Version 13.0.1.0.0
#### ADD #### ADD
- Initial commit for CRM Dashboard Module - Initial commit for CRM Dashboard Module
#### 15.07.2022
#### Version 13.0.1.0.3
#### FIX
- Bug fixes for CRM Dashboard Module

14
crm_dashboard/models/crm_dashboard.py

@ -120,7 +120,7 @@ class CRMLead(models.Model):
"""Sales Activity Pie""" """Sales Activity Pie"""
self._cr.execute('''select mail_activity_type.name,COUNT(*) from mail_activity self._cr.execute('''select mail_activity_type.name,COUNT(*) from mail_activity
inner join mail_activity_type on mail_activity.activity_type_id = mail_activity_type.id inner join mail_activity_type on mail_activity.activity_type_id = mail_activity_type.id
where res_model = 'crm.lead' GROUP BY mail_activity_type.name''') where mail_activity.res_model = 'crm.lead' GROUP BY mail_activity_type.name''')
data = self._cr.dictfetchall() data = self._cr.dictfetchall()
name = [] name = []
@ -376,7 +376,7 @@ class CRMLead(models.Model):
self.achievement_amount = achievement self.achievement_amount = achievement
percent = 0 percent = 0
if total != 0: if total > 0:
percent = (achievement * 100 / total) / 100 percent = (achievement * 100 / total) / 100
goals.append(achievement) goals.append(achievement)
@ -586,7 +586,10 @@ class CRMLead(models.Model):
if len(data) != 3: if len(data) != 3:
del data del data
else: else:
ratio = round(data[1] / data[2], 2) if data[2] == 0:
ratio = 0
else:
ratio = round(data[1] / data[2], 2)
data.append(str(ratio)) data.append(str(ratio))
salesperson_wise_ratio.append(data) salesperson_wise_ratio.append(data)
@ -624,7 +627,10 @@ class CRMLead(models.Model):
if len(data) != 3: if len(data) != 3:
del data del data
else: else:
ratio = round(data[1] / data[2], 2) if data[2] == 0:
ratio = 0
else:
ratio = round(data[1] / data[2], 2)
data.append(str(ratio)) data.append(str(ratio))
sales_team_wise_ratio.append(data) sales_team_wise_ratio.append(data)

Loading…
Cancel
Save