Fixes for regional feature of Nepal
diff --git a/erpnext/healthcare/doctype/physician/physician.json b/erpnext/healthcare/doctype/physician/physician.json
index e29561e..300dc97 100644
--- a/erpnext/healthcare/doctype/physician/physician.json
+++ b/erpnext/healthcare/doctype/physician/physician.json
@@ -750,7 +750,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-01-19 15:25:43.166877",
+ "modified": "2018-03-09 15:25:43.166877",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Physician",
diff --git a/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py b/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py
index bf28644..139751a 100644
--- a/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py
+++ b/erpnext/patches/v10_0/remove_and_copy_fields_in_physician.py
@@ -1,12 +1,13 @@
import frappe
def execute():
- if frappe.db.exists("DocType", "Physician"):
- frappe.reload_doc("healthcare", "doctype", "physician")
- frappe.reload_doc("healthcare", "doctype", "physician_service_unit_schedule")
- if frappe.db.has_column('Physician', 'physician_schedule'):
- for doc in frappe.get_all('Physician'):
- _doc = frappe.get_doc('Physician', doc.name)
- if _doc.physician_schedule:
- _doc.append('physician_schedules', {'schedule': _doc.physician_schedule})
- _doc.save()
+ if frappe.db.exists("DocType", "Physician"):
+ frappe.reload_doc("healthcare", "doctype", "physician")
+ frappe.reload_doc("healthcare", "doctype", "physician_service_unit_schedule")
+
+ if frappe.db.has_column('Physician', 'physician_schedule'):
+ for doc in frappe.get_all('Physician'):
+ _doc = frappe.get_doc('Physician', doc.name)
+ if _doc.physician_schedule:
+ _doc.append('physician_schedules', {'schedule': _doc.physician_schedule})
+ _doc.save()
diff --git a/erpnext/regional/nepal/utils.py b/erpnext/regional/nepal/utils.py
index 66536ee..76801b9 100644
--- a/erpnext/regional/nepal/utils.py
+++ b/erpnext/regional/nepal/utils.py
@@ -10,9 +10,4 @@
if region not in ["Nepal"]:
return
else:
- frappe.throw(_("Deletion is not permitted for country {0}".format(region)))
-
-# don't remove this function it is used in tests
-def test_method():
- '''test function'''
- return 'overridden'
+ frappe.throw(_("Deletion is not permitted for country {0}".format(region)))
\ No newline at end of file
diff --git a/erpnext/tests/test_regional.py b/erpnext/tests/test_regional.py
index 3f8ebaf..7bd6fa8 100644
--- a/erpnext/tests/test_regional.py
+++ b/erpnext/tests/test_regional.py
@@ -9,11 +9,8 @@
frappe.flags.country = 'India'
self.assertEqual(test_method(), 'overridden')
- frappe.flags.country = 'Nepal'
- self.assertEqual(test_method(), 'overridden')
+ frappe.flags.country = 'Maldives'
+ self.assertEqual(test_method(), 'original')
frappe.flags.country = 'France'
- self.assertEqual(test_method(), 'overridden')
-
- frappe.flags.country = 'Maldives'
- self.assertEqual(test_method(), 'original')
\ No newline at end of file
+ self.assertEqual(test_method(), 'overridden')
\ No newline at end of file