2019-01-22 12:52:20 +00:00
|
|
|
from __future__ import unicode_literals
|
2017-07-12 10:31:24 +00:00
|
|
|
import frappe
|
|
|
|
from erpnext.regional.india import states
|
|
|
|
|
|
|
|
def execute():
|
2017-07-13 08:47:07 +00:00
|
|
|
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
|
|
|
|
|
2017-07-12 10:31:24 +00:00
|
|
|
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'")
|
2017-07-16 15:58:39 +00:00
|
|
|
frappe.db.sql("update `tabAddress` set gst_state_number='05' where gst_state='Uttarakhand'")
|