From 4db3b33dd628b0069a09e1634eb194f24ca74577 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 4 Apr 2013 13:57:35 +0530 Subject: [PATCH] [customer] [fix] on_trash sql syntax --- selling/doctype/customer/customer.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/selling/doctype/customer/customer.py b/selling/doctype/customer/customer.py index f2d49b33fb..7e16341a4a 100644 --- a/selling/doctype/customer/customer.py +++ b/selling/doctype/customer/customer.py @@ -188,11 +188,11 @@ class DocType(TransactionBase): self.doc.name, raise_exception=1) def delete_customer_address(self): - for rec in sql("select * from `tabAddress` where customer='%s'" %(self.doc.name), as_dict=1): - sql("delete from `tabAddress` where name=%s",(rec['name'])) + for rec in sql("select * from `tabAddress` where customer=%s", (self.doc.name,), as_dict=1): + sql("delete from `tabAddress` where name=%s", (rec['name'])) def delete_customer_contact(self): - for rec in sql("select * from `tabContact` where customer='%s'" %(self.doc.name), as_dict=1): + 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'])) def delete_customer_communication(self): @@ -236,8 +236,7 @@ class DocType(TransactionBase): ('Serial No', 'customer'), ('Shipping Address', 'customer'), ('Stock Entry', 'customer'), - ('Support Ticket', 'customer'), - ('Task', 'customer')] + ('Support Ticket', 'customer')] for rec in update_fields: sql("""update `tab%s` set customer_name = %s where `%s` = %s""" % (rec[0], "%s" ,rec[1], "%s"), (new, old))