[patch][fix] update gst_state only if company country is india
This commit is contained in:
@@ -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'")
|
||||
|
||||
Reference in New Issue
Block a user