From 10a4a13e5e03f9a92207935e643685b17f0b48ee Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 4 Jul 2017 16:45:29 +0530 Subject: [PATCH] Remove gst reports for non indian accounts (#9553) * remove gst reports for non indian accounts * [Fix] GSN code auto name --- erpnext/patches.txt | 1 + ...roles_from_gst_report_non_indian_account.py | 18 ++++++++++++++++++ .../doctype/gst_hsn_code/gst_hsn_code.json | 5 +++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 111bf88999..30a24f8719 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -410,3 +410,4 @@ erpnext.patches.v8_0.save_system_settings erpnext.patches.v8_1.delete_deprecated_reports erpnext.patches.v8_1.setup_gst_india #2017-06-27 execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code') +erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account \ No newline at end of file diff --git a/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py new file mode 100644 index 0000000000..2feb4838e7 --- /dev/null +++ b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py @@ -0,0 +1,18 @@ +# Copyright (c) 2017, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.reload_doc('core', 'doctype', 'has_role') + company = frappe.get_all('Company', filters = {'country': 'India'}) + + if not company: + frappe.db.sql(""" + delete from + `tabHas Role` + where + parenttype = 'Report' and parent in('GST Sales Register', + 'GST Purchase Register', 'GST Itemised Sales Register', + 'GST Itemised Purchase Register')""") \ No newline at end of file diff --git a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json index 6f1221352e..23cf082362 100644 --- a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json +++ b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json @@ -84,7 +84,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-06-29 21:28:09.053351", + "modified": "2017-06-30 20:12:57.903983", "modified_by": "Administrator", "module": "Regional", "name": "GST HSN Code", @@ -94,10 +94,11 @@ "quick_entry": 1, "read_only": 0, "read_only_onload": 0, - "search_fields": "description", + "search_fields": "hsn_code, description", "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", + "title_field": "hsn_code", "track_changes": 1, "track_seen": 0 } \ No newline at end of file