Skip to content

Commit

Permalink
fix: fetch appointment letter content in the same order as template (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal authored and conncampbell committed Jan 9, 2022
1 parent 53e79e4 commit 6416a31
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions erpnext/hr/doctype/appointment_letter/appointment_letter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6416a31

Please sign in to comment.