Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion crm/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
from frappe.core.api.file import get_max_file_size
from frappe.translate import get_all_translations
from frappe.utils import cstr, split_emails, validate_email_address
from frappe.utils.modules import get_modules_from_all_apps_for_user
#from frappe.utils import get_modules_from_all_apps_for_user
from frappe.utils.telemetry import POSTHOG_HOST_FIELD, POSTHOG_PROJECT_FIELD


# Compatibility patch for Frappe v15
def get_modules_from_all_apps_for_user(user=None):
"""Return modules accessible to a user (simplified)."""
if not user:
user = frappe.session.user

# Fetch modules from Module Def
modules = frappe.get_all("Module Def", fields=["module_name", "app_name"])
return modules

@frappe.whitelist(allow_guest=True)
def get_translations():
if frappe.session.user != "Guest":
Expand Down
5 changes: 3 additions & 2 deletions crm/fcrm/doctype/crm_call_log/crm_call_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Telephony Medium",
"options": "\nManual\nTwilio\nExotel",
"options": "\nManual\nTwilio\nExotel\nRingCentral",
"read_only": 1
},
{
Expand All @@ -157,7 +157,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-04-01 16:01:54.479309",
"modified": "2025-09-20 19:22:14.119322",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Call Log",
Expand Down Expand Up @@ -189,6 +189,7 @@
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "modified",
"sort_order": "DESC",
"states": []
Expand Down
10 changes: 8 additions & 2 deletions crm/fcrm/doctype/crm_deal/crm_deal.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"column_break_kpxa",
"expected_closure_date",
"closed_date",
"card_color",
"contacts_tab",
"contacts",
"contact",
Expand Down Expand Up @@ -427,12 +428,17 @@
"fieldname": "closed_date",
"fieldtype": "Date",
"label": "Closed Date"
},
{
"fieldname": "card_color",
"fieldtype": "Color",
"label": "Card Color"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-08-26 12:12:56.324245",
"modified": "2025-10-16 02:31:48.075612",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Deal",
Expand Down Expand Up @@ -471,4 +477,4 @@
"states": [],
"title_field": "organization",
"track_changes": 1
}
}
16 changes: 16 additions & 0 deletions crm/fcrm/doctype/crm_deal/crm_deal.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ def after_insert(self):

def before_save(self):
self.apply_sla()
self.sync_lead_color()

def sync_lead_color(self):
"""Fetch card_color from linked Lead (if any)"""
if self.lead:
lead_color = frappe.db.get_value("CRM Lead", self.lead, "card_color")
if lead_color and self.card_color != lead_color:
self.card_color = lead_color


def set_primary_contact(self, contact=None):
if not self.contacts:
Expand Down Expand Up @@ -238,6 +247,12 @@ def default_list_data():
"key": "modified",
"width": "8rem",
},
{
"label": "Card Color",
"type": "Color",
"key": "card_color",
"width": "6rem",
},
]
rows = [
"name",
Expand All @@ -253,6 +268,7 @@ def default_list_data():
"first_response_time",
"first_responded_on",
"modified",
"card_color",
"_assign",
]
return {"columns": columns, "rows": rows}
Expand Down
10 changes: 8 additions & 2 deletions crm/fcrm/doctype/crm_lead/crm_lead.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"job_title",
"source",
"lead_owner",
"card_color",
"person_tab",
"salutation",
"first_name",
Expand Down Expand Up @@ -325,13 +326,18 @@
"label": "Net Total",
"options": "currency",
"read_only": 1
},
{
"fieldname": "card_color",
"fieldtype": "Color",
"label": "Card Color"
}
],
"grid_page_length": 50,
"image_field": "image",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-05-14 19:51:06.184569",
"modified": "2025-10-16 02:30:35.253655",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Lead",
Expand Down Expand Up @@ -381,4 +387,4 @@
"states": [],
"title_field": "lead_name",
"track_changes": 1
}
}
9 changes: 8 additions & 1 deletion crm/fcrm/doctype/crm_lead/crm_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ def default_list_data():
"key": "modified",
"width": "8rem",
},
{
"label": "Card Color",
"type": "Color",
"key": "card_color",
"width": "6rem",
},
]
rows = [
"name",
Expand All @@ -387,6 +393,7 @@ def default_list_data():
"first_responded_on",
"modified",
"_assign",
"card_color",
"image",
]
return {"columns": columns, "rows": rows}
Expand All @@ -396,7 +403,7 @@ def default_kanban_settings():
return {
"column_field": "status",
"title_field": "lead_name",
"kanban_fields": '["organization", "email", "mobile_no", "_assign", "modified"]',
"kanban_fields": '["organization", "email", "mobile_no", "_assign", "modified","card_color"]',
}


Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

// frappe.ui.form.on("CRM RingCentral Settings", {
// refresh(frm) {

// },
// });
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2025-09-20 15:09:49.552639",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"enabled",
"client_id",
"client_secret",
"access_token",
"refresh_token",
"token_expiry",
"column_break_xema",
"server_url",
"redirect_uri",
"auth_url"
],
"fields": [
{
"default": "0",
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled"
},
{
"depends_on": "enabled",
"fieldname": "client_id",
"fieldtype": "Data",
"label": "Client ID",
"mandatory_depends_on": "enabled"
},
{
"depends_on": "enabled",
"fieldname": "client_secret",
"fieldtype": "Password",
"label": "Client Secret",
"mandatory_depends_on": "enabled"
},
{
"depends_on": "enabled",
"fieldname": "redirect_uri",
"fieldtype": "Data",
"label": "Redirect Uri",
"mandatory_depends_on": "enabled"
},
{
"depends_on": "enabled",
"fieldname": "refresh_token",
"fieldtype": "Data",
"label": "Refresh Token"
},
{
"depends_on": "enabled",
"fieldname": "access_token",
"fieldtype": "Data",
"label": "Access Token"
},
{
"depends_on": "enabled",
"fieldname": "token_expiry",
"fieldtype": "Datetime",
"label": "Token Expiry"
},
{
"depends_on": "enabled",
"fieldname": "auth_url",
"fieldtype": "Data",
"label": "Auth URL"
},
{
"depends_on": "enabled",
"fieldname": "server_url",
"fieldtype": "Data",
"label": "Server URL"
},
{
"fieldname": "column_break_xema",
"fieldtype": "Column Break"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2025-09-20 15:19:29.775813",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM RingCentral Settings",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class CRMRingCentralSettings(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestCRMRingCentralSettings(FrappeTestCase):
pass
24 changes: 22 additions & 2 deletions crm/fcrm/doctype/crm_telephony_agent/crm_telephony_agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"column_break_aydj",
"exotel",
"exotel_number",
"column_break_hpht",
"ringcentral",
"ringcentral_number",
"section_break_phlq",
"phone_nos"
],
Expand Down Expand Up @@ -100,7 +103,7 @@
"fieldname": "default_medium",
"fieldtype": "Select",
"label": "Default Medium",
"options": "\nTwilio\nExotel"
"options": "\nTwilio\nExotel\nRingCentral"
},
{
"default": "Computer",
Expand All @@ -109,11 +112,27 @@
"fieldtype": "Select",
"label": "Device",
"options": "Computer\nPhone"
},
{
"fieldname": "column_break_hpht",
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "ringcentral",
"fieldtype": "Check",
"label": "Ringcentral"
},
{
"depends_on": "ringcentral",
"fieldname": "ringcentral_number",
"fieldtype": "Data",
"label": "RingCentral Number"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-01-23 22:24:53.448716",
"modified": "2025-09-20 19:24:07.582158",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Telephony Agent",
Expand All @@ -133,6 +152,7 @@
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": [],
Expand Down
2 changes: 2 additions & 0 deletions crm/integrations/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
def is_call_integration_enabled():
twilio_enabled = frappe.db.get_single_value("CRM Twilio Settings", "enabled")
exotel_enabled = frappe.db.get_single_value("CRM Exotel Settings", "enabled")
ringcentral_enabled = frappe.db.get_single_value("CRM RingCentral Settings", "enabled")

return {
"twilio_enabled": twilio_enabled,
"exotel_enabled": exotel_enabled,
"ringcentral_enabled" : ringcentral_enabled,
"default_calling_medium": get_user_default_calling_medium(),
}

Expand Down
Loading