Skip to content

Commit

Permalink
feat: acess DB only one time and load the doc and get field with valu…
Browse files Browse the repository at this point in the history
…es formatted
  • Loading branch information
HarryPaulo committed Aug 8, 2024
1 parent a120747 commit 27240c0
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 27240c0

Please sign in to comment.