[fix] [minor] communication related cleanup
This commit is contained in:
parent
24416f92cc
commit
3a6f4f882a
@ -132,13 +132,9 @@ class DocType(TransactionBase):
|
|||||||
sql("delete from `tabAddress` where name=%s",(rec['name']))
|
sql("delete from `tabAddress` where name=%s",(rec['name']))
|
||||||
|
|
||||||
def delete_supplier_contact(self):
|
def delete_supplier_contact(self):
|
||||||
for rec in sql("select * from `tabContact` where supplier=%s", (self.doc.name,), as_dict=1):
|
for contact in webnotes.conn.sql_list("""select name from `tabContact`
|
||||||
sql("delete from `tabContact` where name=%s",(rec['name']))
|
where supplier=%s""", self.doc.name):
|
||||||
|
webnotes.delete_doc("Contact", contact)
|
||||||
def delete_supplier_communication(self):
|
|
||||||
webnotes.conn.sql("""\
|
|
||||||
delete from `tabCommunication`
|
|
||||||
where supplier = %s and customer is null""", self.doc.name)
|
|
||||||
|
|
||||||
def delete_supplier_account(self):
|
def delete_supplier_account(self):
|
||||||
"""delete supplier's ledger if exist and check balance before deletion"""
|
"""delete supplier's ledger if exist and check balance before deletion"""
|
||||||
|
@ -22,8 +22,3 @@ class DocType(TransactionBase):
|
|||||||
status = "Open"
|
status = "Open"
|
||||||
|
|
||||||
webnotes.conn.set(self.doc, 'status', status)
|
webnotes.conn.set(self.doc, 'status', status)
|
||||||
|
|
||||||
def on_trash(self):
|
|
||||||
webnotes.conn.sql("""delete from `tabCommunication`
|
|
||||||
where job_applicant=%s""", self.doc.name)
|
|
||||||
|
|
@ -149,6 +149,7 @@ def install_python_modules():
|
|||||||
exec_in_shell("easy_install pip")
|
exec_in_shell("easy_install pip")
|
||||||
|
|
||||||
exec_in_shell("pip install --upgrade pip")
|
exec_in_shell("pip install --upgrade pip")
|
||||||
|
exec_in_shell("pip install --upgrade setuptools")
|
||||||
exec_in_shell("pip install --upgrade virtualenv")
|
exec_in_shell("pip install --upgrade virtualenv")
|
||||||
exec_in_shell("pip install -q %s" % python_modules)
|
exec_in_shell("pip install -q %s" % python_modules)
|
||||||
|
|
||||||
|
@ -126,13 +126,9 @@ class DocType(TransactionBase):
|
|||||||
webnotes.conn.sql("""delete from `tabAddress` where name=%s""", name)
|
webnotes.conn.sql("""delete from `tabAddress` where name=%s""", name)
|
||||||
|
|
||||||
def delete_customer_contact(self):
|
def delete_customer_contact(self):
|
||||||
for rec in sql("select * from `tabContact` where customer=%s", (self.doc.name,), as_dict=1):
|
for contact in webnotes.conn.sql_list("""select name from `tabContact`
|
||||||
sql("delete from `tabContact` where name=%s",(rec['name']))
|
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):
|
def delete_customer_account(self):
|
||||||
"""delete customer's ledger if exist and check balance before deletion"""
|
"""delete customer's ledger if exist and check balance before deletion"""
|
||||||
@ -145,7 +141,6 @@ class DocType(TransactionBase):
|
|||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
self.delete_customer_address()
|
self.delete_customer_address()
|
||||||
self.delete_customer_contact()
|
self.delete_customer_contact()
|
||||||
self.delete_customer_communication()
|
|
||||||
self.delete_customer_account()
|
self.delete_customer_account()
|
||||||
if self.doc.lead_name:
|
if self.doc.lead_name:
|
||||||
sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name)
|
sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name)
|
||||||
|
@ -80,7 +80,6 @@ class DocType(SellingController):
|
|||||||
return webnotes.conn.get_value('Sales Email Settings',None,'email_id')
|
return webnotes.conn.get_value('Sales Email Settings',None,'email_id')
|
||||||
|
|
||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
webnotes.conn.sql("""update tabCommunication set lead=null where lead=%s""", self.doc.name)
|
|
||||||
webnotes.conn.sql("""update `tabSupport Ticket` set lead='' where lead=%s""",
|
webnotes.conn.sql("""update `tabSupport Ticket` set lead='' where lead=%s""",
|
||||||
self.doc.name)
|
self.doc.name)
|
||||||
|
|
||||||
|
@ -204,11 +204,6 @@ class DocType(SellingController):
|
|||||||
print_lst.append(lst1)
|
print_lst.append(lst1)
|
||||||
return print_lst
|
return print_lst
|
||||||
|
|
||||||
def update_followup_details(self):
|
|
||||||
sql("delete from `tabCommunication Log` where parent = '%s'"%self.doc.name)
|
|
||||||
for d in getlist(self.doclist, 'follow_up'):
|
|
||||||
d.save()
|
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def make_sales_order(source_name, target_doclist=None):
|
def make_sales_order(source_name, target_doclist=None):
|
||||||
return _make_sales_order(source_name, target_doclist)
|
return _make_sales_order(source_name, target_doclist)
|
||||||
|
@ -55,7 +55,5 @@ class DocType(TransactionBase):
|
|||||||
self.doc.is_primary_contact = 1
|
self.doc.is_primary_contact = 1
|
||||||
|
|
||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
webnotes.conn.sql("""update tabCommunication set contact='' where contact=%s""",
|
|
||||||
self.doc.name)
|
|
||||||
webnotes.conn.sql("""update `tabSupport Ticket` set contact='' where contact=%s""",
|
webnotes.conn.sql("""update `tabSupport Ticket` set contact='' where contact=%s""",
|
||||||
self.doc.name)
|
self.doc.name)
|
Loading…
x
Reference in New Issue
Block a user