fix: fetch appointment letter content in the same order as template (#28968)
This commit is contained in:
parent
d7148adee5
commit
92e86f2f09
@ -12,14 +12,15 @@ class AppointmentLetter(Document):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_appointment_letter_details(template):
|
def get_appointment_letter_details(template):
|
||||||
body = []
|
body = []
|
||||||
intro= frappe.get_list("Appointment Letter Template",
|
intro = frappe.get_list('Appointment Letter Template',
|
||||||
fields=['introduction', 'closing_notes'],
|
fields=['introduction', 'closing_notes'],
|
||||||
filters={'name': template
|
filters={'name': template}
|
||||||
})[0]
|
)[0]
|
||||||
content = frappe.get_list("Appointment Letter content",
|
content = frappe.get_all('Appointment Letter content',
|
||||||
fields=['title', 'description'],
|
fields=['title', 'description'],
|
||||||
filters={'parent': template
|
filters={'parent': template},
|
||||||
})
|
order_by='idx'
|
||||||
|
)
|
||||||
body.append(intro)
|
body.append(intro)
|
||||||
body.append({'description': content})
|
body.append({'description': content})
|
||||||
return body
|
return body
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user