Browse Source

May 15: [FIX] Bug Fixed 'crm_dashboard'

pull/317/head
RisvanaCybro 12 months ago
parent
commit
ec4d77d0a9
  1. 2
      crm_dashboard/__manifest__.py
  2. 2
      crm_dashboard/doc/RELEASE_NOTES.md
  3. 7
      crm_dashboard/models/crm_lead.py
  4. 1
      crm_dashboard/static/src/js/crm_dashboard.js

2
crm_dashboard/__manifest__.py

@ -21,7 +21,7 @@
################################################################################ ################################################################################
{ {
'name': "CRM Dashboard", 'name': "CRM Dashboard",
'version': '17.0.1.0.0', 'version': '17.0.1.0.1',
'category': 'Extra Tools', 'category': 'Extra Tools',
'summary': """Get a visual report of CRM through a Dashboard in CRM """, 'summary': """Get a visual report of CRM through a Dashboard in CRM """,
'description': """CRM dashboard module brings a multipurpose graphical 'description': """CRM dashboard module brings a multipurpose graphical

2
crm_dashboard/doc/RELEASE_NOTES.md

@ -1,6 +1,6 @@
## Module <crm_dashboard> ## Module <crm_dashboard>
#### 28.12.2023 #### 15.05.2024
#### Version 17.0.1.0.0 #### Version 17.0.1.0.0
#### ADD #### ADD
- Initial commit for CRM Dashboard - Initial commit for CRM Dashboard

7
crm_dashboard/models/crm_lead.py

@ -372,7 +372,10 @@ class CRMLead(models.Model):
group by extract(month from create_date) order by extract( group by extract(month from create_date) order by extract(
month from create_date);''' % month_string) month from create_date);''' % month_string)
data = self._cr.dictfetchall() data = self._cr.dictfetchall()
print("data", data)
for rec in data: for rec in data:
print("RECCCCCCC", rec)
if rec.get("date_part"):
datetime_object = datetime.strptime( datetime_object = datetime.strptime(
str(int(rec['date_part'])), "%m") str(int(rec['date_part'])), "%m")
month_name = datetime_object.strftime("%B") month_name = datetime_object.strftime("%B")
@ -398,7 +401,8 @@ class CRMLead(models.Model):
ORDER BY COUNT(country_id) DESC''') ORDER BY COUNT(country_id) DESC''')
data_lost = self._cr.fetchall() data_lost = self._cr.fetchall()
country_wise_ratio = [[won[0], won[1], str(round(won[1] / next( country_wise_ratio = [[won[0], won[1], str(round(won[1] / next(
(lost[1] for lost in data_lost if lost[0] == won[0]), 1), (lost[1] for lost in data_lost if
lost[0] == won[0] and lost[0] != 0 and won[1] != 0), 1),
2))] for won in 2))] for won in
data_won[:5]] data_won[:5]]
return {'country_wise_ratio': country_wise_ratio} return {'country_wise_ratio': country_wise_ratio}
@ -506,7 +510,6 @@ class CRMLead(models.Model):
[('user_id', '=', False), ('type', '=', 'lead')]) [('user_id', '=', False), ('type', '=', 'lead')])
return {'count_unassigned': count_unassigned} return {'count_unassigned': count_unassigned}
@api.model
@api.model @api.model
def get_top_sp_by_invoice(self, kwargs): def get_top_sp_by_invoice(self, kwargs):
"""Top 10 Sales Person by Invoice Table""" """Top 10 Sales Person by Invoice Table"""

1
crm_dashboard/static/src/js/crm_dashboard.js

@ -819,7 +819,6 @@ export class CRMDashboard extends Component {
render_lost_leads_graph() { render_lost_leads_graph() {
var self = this; var self = this;
var ctx = $(".lost_leads_graph"); var ctx = $(".lost_leads_graph");
console.log(ctx)
jsonrpc('/web/dataset/call_kw/crm.lead/get_lost_lead_by_reason_pie', { jsonrpc('/web/dataset/call_kw/crm.lead/get_lost_lead_by_reason_pie', {
model: "crm.lead", model: "crm.lead",
method: "get_lost_lead_by_reason_pie", method: "get_lost_lead_by_reason_pie",

Loading…
Cancel
Save