From c01db5fe9cc6bf6aae4e45117fec51da7803919c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 9 Jun 2014 18:01:14 +0530 Subject: [PATCH] Save default letterhead --- erpnext/patches.txt | 1 + erpnext/patches/v4_0/save_default_letterhead.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 erpnext/patches/v4_0/save_default_letterhead.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 4d69a0fd4f..64cbc4033d 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -56,3 +56,4 @@ erpnext.patches.v4_0.update_tax_amount_after_discount execute:frappe.reset_perms("GL Entry") #2014-06-09 execute:frappe.reset_perms("Stock Ledger Entry") #2014-06-09 erpnext.patches.v4_0.create_custom_fields_for_india_specific_fields +erpnext.patches.v4_0.save_default_letterhead diff --git a/erpnext/patches/v4_0/save_default_letterhead.py b/erpnext/patches/v4_0/save_default_letterhead.py new file mode 100644 index 0000000000..a6db0cdece --- /dev/null +++ b/erpnext/patches/v4_0/save_default_letterhead.py @@ -0,0 +1,13 @@ +# 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(): + """save default letterhead to set default_letter_head_content""" + try: + letter_head = frappe.get_doc("Letter Head", {"is_default": 1}) + letter_head.save() + except frappe.DoesNotExistError: + pass