fix: Traverse note from procedure prescription to appointment

This commit is contained in:
Jamsheer 2018-11-19 17:02:48 +05:30
parent f3c4f5a901
commit 3e01891e22

View File

@ -27,6 +27,10 @@ class PatientAppointment(Document):
def after_insert(self):
if self.procedure_prescription:
frappe.db.set_value("Procedure Prescription", self.procedure_prescription, "appointment_booked", True)
if self.procedure_template:
comments = frappe.db.get_value("Procedure Prescription", self.procedure_prescription, "comments")
if comments:
frappe.db.set_value("Patient Appointment", self.name, "notes", comments)
# Check fee validity exists
appointment = self
validity_exist = validity_exists(appointment.practitioner, appointment.patient)