From 2e3ce6cc0238a9a080ec8a6310762818d292d3b5 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 24 Jan 2012 11:37:28 +0530 Subject: [PATCH] Fix error in patch due to single quote in name --- .../patches/jan_mar_2012/customer_address_contact_patch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py index 6a7d40568c..b55acd4d51 100644 --- a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py +++ b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py @@ -31,7 +31,7 @@ def patch_primary_contact(): GROUP BY sales_partner HAVING SUM(IFNULL(is_primary_contact, 0))=0 ) """, as_list=1) - names = ", ".join(["'" + str(r[0]) + "'" for r in res if r]) + names = ", ".join(['"' + str(r[0]) + '"' for r in res if r]) if names: webnotes.conn.sql("UPDATE `tabContact` SET is_primary_contact=1 WHERE name IN (%s)" % names) def patch_primary_address(): @@ -54,5 +54,5 @@ def patch_primary_address(): AND SUM(IFNULL(is_shipping_address, 0))=0 ) """, as_list=1) - names = ", ".join(["'" + str(r[0]) + "'" for r in res if r]) + names = ", ".join(['"' + str(r[0]) + '"' for r in res if r]) if names: webnotes.conn.sql("UPDATE `tabAddress` SET is_primary_address=1 WHERE name IN (%s)" % names)