From cc9c7d5e2ac6dbc3d85dba32f18d67128a0fe1e2 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 10 Jul 2018 15:41:42 +0530 Subject: [PATCH] [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 --- erpnext/patches.txt | 1 + .../v10_0/update_address_template_for_india.py | 12 ++++++++++++ erpnext/setup/doctype/company/company.py | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v10_0/update_address_template_for_india.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index ade6217190..3ddf6f9cca 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -503,3 +503,4 @@ erpnext.patches.v10_0.taxes_issue_with_pos 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 0000000000..5897b43c35 --- /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 e56c0912e8..dea5bfcee5 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -355,7 +355,7 @@ def install_country_fixtures(company): 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")