Browse Source

[UPDT] Bug Fix 'crm_dashboard'

pull/213/head
AjmalCybro 3 years ago
parent
commit
51342d0d2d
  1. 2
      crm_dashboard/__manifest__.py
  2. 5
      crm_dashboard/doc/RELEASE_NOTES.md
  3. 10
      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""",
'summary': """Detailed Dashboard View for CRM""",
'category': 'Sales',
'version': '13.0.1.0.2',
'version': '13.0.1.0.3',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions',

5
crm_dashboard/doc/RELEASE_NOTES.md

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

10
crm_dashboard/models/crm_dashboard.py

@ -120,7 +120,7 @@ class CRMLead(models.Model):
"""Sales Activity Pie"""
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
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()
name = []
@ -376,7 +376,7 @@ class CRMLead(models.Model):
self.achievement_amount = achievement
percent = 0
if total != 0:
if total > 0:
percent = (achievement * 100 / total) / 100
goals.append(achievement)
@ -585,6 +585,9 @@ class CRMLead(models.Model):
for data in won:
if len(data) != 3:
del data
else:
if data[2] == 0:
ratio = 0
else:
ratio = round(data[1] / data[2], 2)
data.append(str(ratio))
@ -623,6 +626,9 @@ class CRMLead(models.Model):
for data in won:
if len(data) != 3:
del data
else:
if data[2] == 0:
ratio = 0
else:
ratio = round(data[1] / data[2], 2)
data.append(str(ratio))

Loading…
Cancel
Save