Sfoglia il codice sorgente

Merge pull request #13340 from frappe/mergify/bp/develop/pr-13339

fix: display currency in auto email report (backport #13339)
version-14
Leela vadlamudi 4 anni fa
committed by GitHub
parent
commit
f1d54442e1
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. +5
    -3
      frappe/email/doctype/auto_email_report/auto_email_report.py

+ 5
- 3
frappe/email/doctype/auto_email_report/auto_email_report.py Vedi File

@@ -245,6 +245,7 @@ def send_monthly():


def make_links(columns, data): def make_links(columns, data):
for row in data: for row in data:
doc_name = row.get('name')
for col in columns: for col in columns:
if col.fieldtype == "Link" and col.options != "Currency": if col.fieldtype == "Link" and col.options != "Currency":
if col.options and row.get(col.fieldname): if col.options and row.get(col.fieldname):
@@ -253,8 +254,9 @@ def make_links(columns, data):
if col.options and row.get(col.fieldname) and row.get(col.options): if col.options and row.get(col.fieldname) and row.get(col.options):
row[col.fieldname] = get_link_to_form(row[col.options], row[col.fieldname]) 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" and row.get(col.fieldname):
row[col.fieldname] = frappe.format_value(row[col.fieldname], col)

doc = frappe.get_doc(col.parent, doc_name) if doc_name 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)
return columns, data return columns, data


def update_field_types(columns): def update_field_types(columns):
@@ -262,4 +264,4 @@ def update_field_types(columns):
if col.fieldtype in ("Link", "Dynamic Link", "Currency") and col.options != "Currency": if col.fieldtype in ("Link", "Dynamic Link", "Currency") and col.options != "Currency":
col.fieldtype = "Data" col.fieldtype = "Data"
col.options = "" col.options = ""
return columns
return columns

Caricamento…
Annulla
Salva