Skip to content

Commit

Permalink
Merge pull request #86 from HarryPaulo/format-field-values
Browse files Browse the repository at this point in the history
feat: access DB only one time and load the doc and get field with value formatted
  • Loading branch information
shridarpatil authored Aug 17, 2024
2 parents 2342141 + 27240c0 commit 1711337
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def send_template(self):
parameters = []
template_parameters = []

ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
for field_name in field_names:
value = frappe.db.get_value(
self.reference_doctype, self.reference_name, field_name.strip()
)
value = ref_doc.get_formatted(field_name.strip())

parameters.append({"type": "text", "text": value})
template_parameters.append(value)

Expand Down

0 comments on commit 1711337

Please sign in to comment.