fix(minor): patch add_state_code_for_ladakh
diff --git a/erpnext/patches/v12_0/add_state_code_for_ladakh.py b/erpnext/patches/v12_0/add_state_code_for_ladakh.py
index d41101c..29a7b4b 100644
--- a/erpnext/patches/v12_0/add_state_code_for_ladakh.py
+++ b/erpnext/patches/v12_0/add_state_code_for_ladakh.py
@@ -11,6 +11,7 @@
# 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()
+ if frappe.db.exists('Custom Field', field):
+ gst_state_field = frappe.get_doc('Custom Field', field)
+ gst_state_field.options = '\n'.join(states)
+ gst_state_field.save()
diff --git a/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py b/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py
index aea53f8..833c355 100644
--- a/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py
+++ b/erpnext/patches/v13_0/setup_fields_for_80g_certificate_and_donation.py
@@ -2,15 +2,12 @@
from erpnext.regional.india.setup import make_custom_fields
def execute():
- company = frappe.get_all('Company', filters = {'country': 'India'})
- if not company:
- return
+ if frappe.get_all('Company', filters = {'country': 'India'}):
+ make_custom_fields()
- make_custom_fields()
-
- if not frappe.db.exists('Party Type', 'Donor'):
- frappe.get_doc({
- 'doctype': 'Party Type',
- 'party_type': 'Donor',
- 'account_type': 'Receivable'
- }).insert(ignore_permissions=True)
\ No newline at end of file
+ if not frappe.db.exists('Party Type', 'Donor'):
+ frappe.get_doc({
+ 'doctype': 'Party Type',
+ 'party_type': 'Donor',
+ 'account_type': 'Receivable'
+ }).insert(ignore_permissions=True)