mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 14:09:19 +00:00
fix: Update state code and union territory for Daman and Diu (#22989)
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
@@ -673,3 +673,4 @@ erpnext.patches.v12_0.set_italian_import_supplier_invoice_permissions
|
|||||||
execute:frappe.reload_doc("HR", "doctype", "Employee Advance")
|
execute:frappe.reload_doc("HR", "doctype", "Employee Advance")
|
||||||
erpnext.patches.v12_0.move_due_advance_amount_to_pending_amount
|
erpnext.patches.v12_0.move_due_advance_amount_to_pending_amount
|
||||||
erpnext.patches.v12_0.set_multi_uom_in_rfq
|
erpnext.patches.v12_0.set_multi_uom_in_rfq
|
||||||
|
erpnext.patches.v12_0.update_state_code_for_daman_and_diu
|
||||||
|
|||||||
22
erpnext/patches/v12_0/update_state_code_for_daman_and_diu.py
Normal file
22
erpnext/patches/v12_0/update_state_code_for_daman_and_diu.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import frappe
|
||||||
|
from erpnext.regional.india import states
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
|
||||||
|
company = frappe.get_all('Company', filters = {'country': 'India'})
|
||||||
|
if not company:
|
||||||
|
return
|
||||||
|
|
||||||
|
# Update options in gst_state custom field
|
||||||
|
gst_state = frappe.get_doc('Custom Field', 'Address-gst_state')
|
||||||
|
gst_state.options = '\n'.join(states)
|
||||||
|
gst_state.save()
|
||||||
|
|
||||||
|
# Update gst_state and state code in existing address
|
||||||
|
frappe.db.sql("""
|
||||||
|
UPDATE `tabAddress`
|
||||||
|
SET
|
||||||
|
gst_state = 'Dadra and Nagar Haveli and Daman and Diu',
|
||||||
|
gst_state_number = 26
|
||||||
|
WHERE gst_state = 'Daman and Diu'
|
||||||
|
""")
|
||||||
@@ -10,8 +10,7 @@ states = [
|
|||||||
'Bihar',
|
'Bihar',
|
||||||
'Chandigarh',
|
'Chandigarh',
|
||||||
'Chhattisgarh',
|
'Chhattisgarh',
|
||||||
'Dadra and Nagar Haveli',
|
'Dadra and Nagar Haveli and Daman and Diu',
|
||||||
'Daman and Diu',
|
|
||||||
'Delhi',
|
'Delhi',
|
||||||
'Goa',
|
'Goa',
|
||||||
'Gujarat',
|
'Gujarat',
|
||||||
@@ -50,8 +49,7 @@ state_numbers = {
|
|||||||
"Bihar": "10",
|
"Bihar": "10",
|
||||||
"Chandigarh": "04",
|
"Chandigarh": "04",
|
||||||
"Chhattisgarh": "22",
|
"Chhattisgarh": "22",
|
||||||
"Dadra and Nagar Haveli": "26",
|
"Dadra and Nagar Haveli and Daman and Diu": "26",
|
||||||
"Daman and Diu": "25",
|
|
||||||
"Delhi": "07",
|
"Delhi": "07",
|
||||||
"Goa": "30",
|
"Goa": "30",
|
||||||
"Gujarat": "24",
|
"Gujarat": "24",
|
||||||
|
|||||||
@@ -134,15 +134,10 @@
|
|||||||
"state_code": "DL",
|
"state_code": "DL",
|
||||||
"state_name": "Delhi"
|
"state_name": "Delhi"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"state_number": "25",
|
|
||||||
"state_code": "DD",
|
|
||||||
"state_name": "Daman and Diu"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"state_number": "26",
|
"state_number": "26",
|
||||||
"state_code": "DN",
|
"state_code": "DN",
|
||||||
"state_name": "Dadra and Nagar Haveli"
|
"state_name": "Dadra and Nagar Haveli and Daman and Diu"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"state_number": "22",
|
"state_number": "22",
|
||||||
|
|||||||
Reference in New Issue
Block a user