[patch][fix] update gst_state only if company country is india

This commit is contained in:
Saurabh 2017-07-13 14:17:07 +05:30
parent 012f5b0a50
commit e74e4b18c7
2 changed files with 9 additions and 2 deletions

View File

@ -415,5 +415,5 @@ erpnext.patches.v8_1.gst_fixes #2017-07-06
erpnext.patches.v8_0.update_production_orders
erpnext.patches.v8_1.remove_sales_invoice_from_returned_serial_no
erpnext.patches.v8_1.allow_invoice_copy_to_edit_after_submit
erpnext.patches.v8_1.update_gst_state
erpnext.patches.v8_1.add_hsn_sac_codes
erpnext.patches.v8_1.add_hsn_sac_codes
erpnext.patches.v8_1.update_gst_state

View File

@ -2,5 +2,12 @@ import frappe
from erpnext.regional.india import states
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
if not frappe.db.get_value("Custom Field", filters={'fieldname':'gst_state'}):
return
frappe.db.sql("update `tabCustom Field` set options=%s where fieldname='gst_state'", '\n'.join(states))
frappe.db.sql("update `tabAddress` set gst_state='Chhattisgarh' where gst_state='Chattisgarh'")