brotherton-erpnext/erpnext/patches/v4_2/delete_old_print_formats.py
Rushabh Mehta ee4b8bee33 Revert "[patches] removed 4.0 patches"
This reverts commit 6f7cba8d730bcc3a7ac6d7102cce0a8369419956.
2014-12-31 15:01:48 +05:30

24 lines
949 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
old_formats = ("Sales Invoice", "Sales Invoice Spartan", "Sales Invoice Modern",
"Sales Invoice Classic",
"Sales Order Spartan", "Sales Order Modern", "Sales Order Classic",
"Purchase Order Spartan", "Purchase Order Modern", "Purchase Order Classic",
"Quotation Spartan", "Quotation Modern", "Quotation Classic",
"Delivery Note Spartan", "Delivery Note Modern", "Delivery Note Classic")
for fmt in old_formats:
# update property setter
for ps in frappe.db.sql_list("""select name from `tabProperty Setter`
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_if_exists("Print Format", fmt)