Merge pull request #24632 from ankush/ladakh_gst_addition

fix(India): Add GST state code for Ladakh
This commit is contained in:
Deepesh Garg 2021-02-15 21:11:54 +05:30 committed by GitHub
commit 79f63526cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 1 deletions

View File

@ -752,3 +752,4 @@ erpnext.patches.v13_0.set_company_in_leave_ledger_entry
erpnext.patches.v13_0.convert_qi_parameter_to_link_field
erpnext.patches.v13_0.setup_patient_history_settings_for_standard_doctypes
erpnext.patches.v13_0.add_naming_series_to_old_projects # 1-02-2021
erpnext.patches.v12_0.add_state_code_for_ladakh

View File

@ -0,0 +1,16 @@
import frappe
from erpnext.regional.india import states
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
custom_fields = ['Address-gst_state', 'Tax Category-gst_state']
# Update options in gst_state custom fields
for field in custom_fields:
gst_state_field = frappe.get_doc('Custom Field', field)
gst_state_field.options = '\n'.join(states)
gst_state_field.save()

View File

@ -20,6 +20,7 @@ states = [
'Jharkhand',
'Karnataka',
'Kerala',
'Ladakh',
'Lakshadweep Islands',
'Madhya Pradesh',
'Maharashtra',
@ -59,6 +60,7 @@ state_numbers = {
"Jharkhand": "20",
"Karnataka": "29",
"Kerala": "32",
"Ladakh": "38",
"Lakshadweep Islands": "31",
"Madhya Pradesh": "23",
"Maharashtra": "27",
@ -80,4 +82,4 @@ state_numbers = {
"West Bengal": "19",
}
number_state_mapping = {v: k for k, v in iteritems(state_numbers)}
number_state_mapping = {v: k for k, v in iteritems(state_numbers)}

View File

@ -168,5 +168,10 @@
"state_number": "37",
"state_code": "AD",
"state_name": "Andhra Pradesh (New)"
},
{
"state_number": "38",
"state_code": "LA",
"state_name": "Ladakh"
}
]