Merge pull request #14888 from abdgad/auto_email_report-cleanup
refactor: minor code cleanup in auto_email_report.py
This commit is contained in:
commit
177f85b4cd
1 changed files with 7 additions and 4 deletions
|
|
@ -242,13 +242,16 @@ def make_links(columns, data):
|
|||
for row in data:
|
||||
doc_name = row.get('name')
|
||||
for col in columns:
|
||||
if col.fieldtype == "Link" and col.options != "Currency":
|
||||
if col.options and row.get(col.fieldname):
|
||||
if not row.get(col.fieldname):
|
||||
continue
|
||||
|
||||
if col.fieldtype == "Link":
|
||||
if col.options and col.options != "Currency":
|
||||
row[col.fieldname] = get_link_to_form(col.options, row[col.fieldname])
|
||||
elif col.fieldtype == "Dynamic Link":
|
||||
if col.options and row.get(col.fieldname) and row.get(col.options):
|
||||
if col.options and row.get(col.options):
|
||||
row[col.fieldname] = get_link_to_form(row[col.options], row[col.fieldname])
|
||||
elif col.fieldtype == "Currency" and row.get(col.fieldname):
|
||||
elif col.fieldtype == "Currency":
|
||||
doc = frappe.get_doc(col.parent, doc_name) if doc_name and col.parent else None
|
||||
# Pass the Document to get the currency based on docfield option
|
||||
row[col.fieldname] = frappe.format_value(row[col.fieldname], col, doc=doc)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue