diff --git a/healthcare/healthcare/doctype/nursing_task/nursing_task.py b/healthcare/healthcare/doctype/nursing_task/nursing_task.py index 769e55d9b5..01d10625cf 100644 --- a/healthcare/healthcare/doctype/nursing_task/nursing_task.py +++ b/healthcare/healthcare/doctype/nursing_task/nursing_task.py @@ -60,7 +60,9 @@ def set_task_schedule(self): if not self.requested_end_time: if not self.duration: - self.duration = frappe.db.get_value("Healthcare Activity", self.activity, "duration") + self.duration = ( + frappe.db.get_value("Healthcare Activity", self.activity, "activity_duration") or 0 + ) self.requested_end_time = add_to_date(self.requested_start_time, seconds=self.duration) # set date based on requested_start_time