fix: fetch appointment letter content in the same order as template (#28968)

This commit is contained in:
Rucha Mahabal 2021-12-20 22:56:15 +05:30 committed by GitHub
parent d7148adee5
commit 92e86f2f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,14 +12,15 @@ class AppointmentLetter(Document):
@frappe.whitelist()
def get_appointment_letter_details(template):
body = []
intro= frappe.get_list("Appointment Letter Template",
fields = ['introduction', 'closing_notes'],
filters={'name': template
})[0]
content = frappe.get_list("Appointment Letter content",
fields = ['title', 'description'],
filters={'parent': template
})
intro = frappe.get_list('Appointment Letter Template',
fields=['introduction', 'closing_notes'],
filters={'name': template}
)[0]
content = frappe.get_all('Appointment Letter content',
fields=['title', 'description'],
filters={'parent': template},
order_by='idx'
)
body.append(intro)
body.append({'description': content})
return body