brotherton-erpnext/erpnext/patches/v4_0/fix_address_template.py
2014-06-06 17:07:50 +05:30

13 lines
416 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
from __future__ import unicode_literals
import frappe
def execute():
missing_line = """{{ address_line1 }}<br>"""
for name, template in frappe.db.sql("select name, template from `tabAddress Template`"):
if missing_line not in template:
d = frappe.get_doc("Address Template", name)
d.template = missing_line + d.template
d.save()