diff --git a/crm/api/dashboard.py b/crm/api/dashboard.py index 5a9c56b8..4bed4218 100644 --- a/crm/api/dashboard.py +++ b/crm/api/dashboard.py @@ -7,6 +7,12 @@ from crm.fcrm.doctype.crm_dashboard.crm_dashboard import create_default_manager_ from crm.utils import sales_user_only +@frappe.whitelist() +def reset_to_default(): + frappe.only_for("System Manager") + create_default_manager_dashboard(force=True) + + @frappe.whitelist() @sales_user_only def get_dashboard(from_date="", to_date="", user=""): diff --git a/crm/integrations/exotel/handler.py b/crm/integrations/exotel/handler.py index 8809be6a..e070cbce 100644 --- a/crm/integrations/exotel/handler.py +++ b/crm/integrations/exotel/handler.py @@ -242,19 +242,18 @@ def get_call_log_status(call_payload, direction="inbound"): elif status == "failed": return "Failed" - status = call_payload.get("DialCallStatus") call_type = call_payload.get("CallType") - dial_call_status = call_payload.get("DialCallStatus") + status = call_payload.get("DialCallStatus") or call_payload.get("Status") - if call_type == "incomplete" and dial_call_status == "no-answer": + if call_type == "incomplete" and status == "no-answer": status = "No Answer" - elif call_type == "client-hangup" and dial_call_status == "canceled": + elif call_type == "client-hangup" and status == "canceled": status = "Canceled" - elif call_type == "incomplete" and dial_call_status == "failed": + elif call_type == "incomplete" and status == "failed": status = "Failed" elif call_type == "completed": status = "Completed" - elif dial_call_status == "busy": + elif status == "busy": status = "Ringing" return status diff --git a/frontend/src/pages/Dashboard.vue b/frontend/src/pages/Dashboard.vue index 0cb7fbd9..ecaea290 100644 --- a/frontend/src/pages/Dashboard.vue +++ b/frontend/src/pages/Dashboard.vue @@ -15,7 +15,7 @@