[hotfix] [patch] Delete old print formats
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 676e0d1..35ee608 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -72,4 +72,4 @@
execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool")
execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail")
execute:frappe.delete_doc("Page", "trial-balance") #2014-07-22
-erpnext.patches.v4_2.delete_old_print_formats
+erpnext.patches.v4_2.delete_old_print_formats #2014-07-29
diff --git a/erpnext/patches/v4_2/delete_old_print_formats.py b/erpnext/patches/v4_2/delete_old_print_formats.py
index 1456f95..75c3619 100644
--- a/erpnext/patches/v4_2/delete_old_print_formats.py
+++ b/erpnext/patches/v4_2/delete_old_print_formats.py
@@ -15,9 +15,9 @@
for fmt in old_formats:
# update property setter
for ps in frappe.db.sql_list("""select name from `tabProperty Setter`
- where property_type='default_print_format' and value=%s""", fmt):
+ where property='default_print_format' and value=%s""", fmt):
ps = frappe.get_doc("Property Setter", ps)
ps.value = "Standard"
ps.save(ignore_permissions = True)
- frappe.delete_doc("Print Format", fmt)
+ frappe.delete_doc_if_exists("Print Format", fmt)