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. 15
      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",
'version': '17.0.1.0.0',
'version': '17.0.1.0.1',
'category': 'Extra Tools',
'summary': """Get a visual report of CRM through a Dashboard in CRM """,
'description': """CRM dashboard module brings a multipurpose graphical

2
crm_dashboard/doc/RELEASE_NOTES.md

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

15
crm_dashboard/models/crm_lead.py

@ -372,11 +372,14 @@ class CRMLead(models.Model):
group by extract(month from create_date) order by extract(
month from create_date);''' % month_string)
data = self._cr.dictfetchall()
print("data", data)
for rec in data:
datetime_object = datetime.strptime(
str(int(rec['date_part'])), "%m")
month_name = datetime_object.strftime("%B")
month_dict[month_name] = rec['count']
print("RECCCCCCC", rec)
if rec.get("date_part"):
datetime_object = datetime.strptime(
str(int(rec['date_part'])), "%m")
month_name = datetime_object.strftime("%B")
month_dict[month_name] = rec['count']
test = {'month': list(month_dict.keys()),
'count': list(month_dict.values())}
return test
@ -398,7 +401,8 @@ class CRMLead(models.Model):
ORDER BY COUNT(country_id) DESC''')
data_lost = self._cr.fetchall()
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
data_won[:5]]
return {'country_wise_ratio': country_wise_ratio}
@ -506,7 +510,6 @@ class CRMLead(models.Model):
[('user_id', '=', False), ('type', '=', 'lead')])
return {'count_unassigned': count_unassigned}
@api.model
@api.model
def get_top_sp_by_invoice(self, kwargs):
"""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() {
var self = this;
var ctx = $(".lost_leads_graph");
console.log(ctx)
jsonrpc('/web/dataset/call_kw/crm.lead/get_lost_lead_by_reason_pie', {
model: "crm.lead",
method: "get_lost_lead_by_reason_pie",

Loading…
Cancel
Save