[Fix] GSTIN not displaying in the address print (#14855)
* [Fix] GSTIN not displaying in the address print
* Made changes in the patch and set Patch as False
* Update update_address_template_for_india.py
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index ade6217..3ddf6f9 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -503,3 +503,4 @@
erpnext.patches.v10_0.set_qty_in_transactions_based_on_serial_no_input
erpnext.patches.v10_0.show_leaves_of_all_department_members_in_calendar
erpnext.patches.v10_0.update_status_in_purchase_receipt
+erpnext.patches.v10_0.update_address_template_for_india
\ No newline at end of file
diff --git a/erpnext/patches/v10_0/update_address_template_for_india.py b/erpnext/patches/v10_0/update_address_template_for_india.py
new file mode 100644
index 0000000..5897b43
--- /dev/null
+++ b/erpnext/patches/v10_0/update_address_template_for_india.py
@@ -0,0 +1,12 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from erpnext.regional.india.setup import update_address_template
+
+def execute():
+ if frappe.db.get_value('Company', {'country': 'India'}, 'name'):
+ address_template = frappe.db.get_value('Address Template', 'India', 'template')
+ if not address_template or "gstin" not in address_template:
+ update_address_template()
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index e56c091..dea5bfc 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -355,7 +355,7 @@
path = frappe.get_app_path('erpnext', 'regional', frappe.scrub(company_doc.country))
if os.path.exists(path.encode("utf-8")):
frappe.get_attr("erpnext.regional.{0}.setup.setup"
- .format(frappe.scrub(company_doc.country)))(company_doc)
+ .format(frappe.scrub(company_doc.country)))(company_doc, False)
def update_company_current_month_sales(company):
current_month_year = formatdate(today(), "MM-yyyy")