mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
[minor] merged with master branch
This commit is contained in:
@@ -126,14 +126,10 @@ class DocType(TransactionBase):
|
||||
webnotes.conn.sql("""delete from `tabAddress` where name=%s""", name)
|
||||
|
||||
def delete_customer_contact(self):
|
||||
for rec in sql("select * from `tabContact` where customer=%s", (self.doc.name,), as_dict=1):
|
||||
sql("delete from `tabContact` where name=%s",(rec['name']))
|
||||
for contact in webnotes.conn.sql_list("""select name from `tabContact`
|
||||
where customer=%s""", self.doc.name):
|
||||
webnotes.delete_doc("Contact", contact)
|
||||
|
||||
def delete_customer_communication(self):
|
||||
webnotes.conn.sql("""\
|
||||
delete from `tabCommunication`
|
||||
where customer = %s and supplier is null""", self.doc.name)
|
||||
|
||||
def delete_customer_account(self):
|
||||
"""delete customer's ledger if exist and check balance before deletion"""
|
||||
acc = sql("select name from `tabAccount` where master_type = 'Customer' \
|
||||
@@ -145,7 +141,6 @@ class DocType(TransactionBase):
|
||||
def on_trash(self):
|
||||
self.delete_customer_address()
|
||||
self.delete_customer_contact()
|
||||
self.delete_customer_communication()
|
||||
self.delete_customer_account()
|
||||
if self.doc.lead_name:
|
||||
sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-06-11 14:26:44",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-09-02 16:25:13",
|
||||
"modified": "2013-09-10 10:50:50",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@@ -195,14 +195,16 @@
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Communication History",
|
||||
"options": "icon-comments",
|
||||
"permlevel": 0
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "communication_html",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Communication HTML",
|
||||
"permlevel": 0
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
@@ -355,7 +357,8 @@
|
||||
"hidden": 1,
|
||||
"label": "Communications",
|
||||
"options": "Communication",
|
||||
"permlevel": 0
|
||||
"permlevel": 0,
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
|
||||
Reference in New Issue
Block a user