fix(Healthcare): set company in healthcare service unit setup (#21929)

This commit is contained in:
Rucha Mahabal 2020-05-26 17:54:46 +05:30 committed by GitHub
parent 74a910ae92
commit c52bbd79bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -195,10 +195,21 @@ def create_sensitivity():
def add_healthcare_service_unit_tree_root(): def add_healthcare_service_unit_tree_root():
record = [ record = [
{ {
"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": get_company()
}
] ]
insert_record(record) insert_record(record)
def get_company():
company = frappe.defaults.get_defaults().company
if company:
return company
else:
company = frappe.get_list("Company", limit=1)
if company:
return company[0].name
return None