commit
02aad03e74
@ -3,12 +3,18 @@ from frappe import _
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
""" assign lft and rgt appropriately """
|
""" assign lft and rgt appropriately """
|
||||||
|
if "Healthcare" not in frappe.get_active_domains():
|
||||||
|
return
|
||||||
|
|
||||||
frappe.reload_doc("healthcare", "doctype", "healthcare_service_unit")
|
frappe.reload_doc("healthcare", "doctype", "healthcare_service_unit")
|
||||||
frappe.reload_doc("healthcare", "doctype", "healthcare_service_unit_type")
|
frappe.reload_doc("healthcare", "doctype", "healthcare_service_unit_type")
|
||||||
|
company = frappe.get_value("Company", {"domain": "Healthcare"}, "name")
|
||||||
|
|
||||||
if not frappe.db.exists("Healthcare Service Unit", _('All Healthcare Service Units')):
|
if company:
|
||||||
frappe.get_doc({
|
frappe.get_doc({
|
||||||
'doctype': 'Healthcare Service Unit',
|
'doctype': 'Healthcare Service Unit',
|
||||||
'healthcare_service_unit_name': _('All Healthcare Service Units'),
|
'healthcare_service_unit_name': _('All Healthcare Service Units'),
|
||||||
'is_group': 1
|
'is_group': 1,
|
||||||
|
'company': company
|
||||||
}).insert(ignore_permissions=True)
|
}).insert(ignore_permissions=True)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user