mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
Merge pull request #23148 from scmmishra/feat-exotel-customer-link
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"autoname": "field:id",
|
"autoname": "field:id",
|
||||||
"creation": "2019-06-05 12:07:02.634534",
|
"creation": "2019-06-05 12:07:02.634534",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
"contact",
|
"contact",
|
||||||
"contact_name",
|
"contact_name",
|
||||||
"column_break_10",
|
"column_break_10",
|
||||||
|
"customer",
|
||||||
"lead",
|
"lead",
|
||||||
"lead_name",
|
"lead_name",
|
||||||
"section_break_5",
|
"section_break_5",
|
||||||
@@ -28,7 +30,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "section_break_5",
|
"fieldname": "section_break_5",
|
||||||
"fieldtype": "Section Break"
|
"fieldtype": "Section Break",
|
||||||
|
"label": "Call Details"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "id",
|
"fieldname": "id",
|
||||||
@@ -125,10 +128,19 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Lead Name",
|
"label": "Lead Name",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "customer",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Customer",
|
||||||
|
"options": "Customer",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"modified": "2019-08-06 05:46:53.144683",
|
"index_web_pages_for_search": 1,
|
||||||
|
"links": [],
|
||||||
|
"modified": "2020-08-25 17:08:34.085731",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Communication",
|
"module": "Communication",
|
||||||
"name": "Call Log",
|
"name": "Call Log",
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ class CallLog(Document):
|
|||||||
self.contact = get_contact_with_phone_number(number)
|
self.contact = get_contact_with_phone_number(number)
|
||||||
self.lead = get_lead_with_phone_number(number)
|
self.lead = get_lead_with_phone_number(number)
|
||||||
|
|
||||||
|
contact = frappe.get_doc("Contact", self.contact)
|
||||||
|
self.customer = contact.get_link_for("Customer")
|
||||||
|
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
self.trigger_call_popup()
|
self.trigger_call_popup()
|
||||||
|
|
||||||
|
|||||||
@@ -184,10 +184,10 @@ class Customer(TransactionBase):
|
|||||||
def validate_credit_limit_on_change(self):
|
def validate_credit_limit_on_change(self):
|
||||||
if self.get("__islocal") or not self.credit_limits:
|
if self.get("__islocal") or not self.credit_limits:
|
||||||
return
|
return
|
||||||
|
|
||||||
past_credit_limits = [d.credit_limit
|
past_credit_limits = [d.credit_limit
|
||||||
for d in frappe.db.get_all("Customer Credit Limit", filters={'parent': self.name}, fields=["credit_limit"], order_by="company")]
|
for d in frappe.db.get_all("Customer Credit Limit", filters={'parent': self.name}, fields=["credit_limit"], order_by="company")]
|
||||||
|
|
||||||
current_credit_limits = [d.credit_limit for d in sorted(self.credit_limits, key=lambda k: k.company)]
|
current_credit_limits = [d.credit_limit for d in sorted(self.credit_limits, key=lambda k: k.company)]
|
||||||
|
|
||||||
if past_credit_limits == current_credit_limits:
|
if past_credit_limits == current_credit_limits:
|
||||||
|
|||||||
Reference in New Issue
Block a user