-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #534 from shariquerik/telephony
- Loading branch information
Showing
29 changed files
with
303 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...type/crm_exotel_agent/crm_exotel_agent.js → ...rm_telephony_agent/crm_telephony_agent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
crm/fcrm/doctype/crm_telephony_agent/crm_telephony_agent.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright (c) 2025, Frappe Technologies Pvt. Ltd. and contributors | ||
# For license information, please see license.txt | ||
|
||
import frappe | ||
from frappe import _ | ||
from frappe.model.document import Document | ||
|
||
|
||
class CRMTelephonyAgent(Document): | ||
def validate(self): | ||
self.set_primary() | ||
|
||
def set_primary(self): | ||
# Used to set primary mobile no. | ||
if len(self.phone_nos) == 0: | ||
self.mobile_no = "" | ||
return | ||
|
||
is_primary = [phone.number for phone in self.phone_nos if phone.get("is_primary")] | ||
|
||
if len(is_primary) > 1: | ||
frappe.throw( | ||
_("Only one {0} can be set as primary.").format(frappe.bold(frappe.unscrub("mobile_no"))) | ||
) | ||
|
||
primary_number_exists = False | ||
for d in self.phone_nos: | ||
if d.get("is_primary") == 1: | ||
primary_number_exists = True | ||
self.mobile_no = d.number | ||
break | ||
|
||
if not primary_number_exists: | ||
self.mobile_no = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
crm/fcrm/doctype/crm_telephony_phone/crm_telephony_phone.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"creation": "2025-01-19 13:57:01.702519", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"number", | ||
"is_primary" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "number", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Number", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"default": "0", | ||
"fieldname": "is_primary", | ||
"fieldtype": "Check", | ||
"in_list_view": 1, | ||
"label": "Is Primary" | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"istable": 1, | ||
"links": [], | ||
"modified": "2025-01-19 13:58:59.063775", | ||
"modified_by": "Administrator", | ||
"module": "FCRM", | ||
"name": "CRM Telephony Phone", | ||
"owner": "Administrator", | ||
"permissions": [], | ||
"sort_field": "creation", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...octype/twilio_settings/twilio_settings.js → ...rm_twilio_settings/crm_twilio_settings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.