Fixes for regional feature of Nepal
This commit is contained in:
parent
38cbd71352
commit
096c05ca6f
@ -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",
|
||||
|
@ -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()
|
||||
|
@ -10,9 +10,4 @@ def check_deletion_permission(doc, method):
|
||||
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)))
|
@ -9,11 +9,8 @@ class TestInit(unittest.TestCase):
|
||||
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')
|
||||
self.assertEqual(test_method(), 'overridden')
|
Loading…
Reference in New Issue
Block a user