From 55e54ef6a1799a4e3e9dcd2542d7c0f5b9676c9e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 May 2019 21:56:44 +0530 Subject: [PATCH] skip the patch for outside India --- erpnext/patches/v10_0/gst_hsn_fixes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v10_0/gst_hsn_fixes.py b/erpnext/patches/v10_0/gst_hsn_fixes.py index 7a65ef3c08f..98cf0a7a2da 100644 --- a/erpnext/patches/v10_0/gst_hsn_fixes.py +++ b/erpnext/patches/v10_0/gst_hsn_fixes.py @@ -3,6 +3,10 @@ from erpnext.regional.india.setup import setup from frappe.custom.doctype.custom_field.custom_field import create_custom_fields def execute(): + company = frappe.get_all('Company', filters = {'country': 'India'}) + if not company: + return + hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC', fieldtype='Data', options='item_code.gst_hsn_code', insert_after='description', allow_on_submit=1, print_hide=1) @@ -11,4 +15,4 @@ def execute(): 'Material Request Item': [hsn_sac_field] } - create_custom_fields(custom_fields) \ No newline at end of file + create_custom_fields(custom_fields)