Browse Source

Merge pull request #4095 from mbauskar/childtable-columns

[minor] show the child table fields lable in Auto Email Report
version-14
Rushabh Mehta 7 years ago
committed by GitHub
parent
commit
13f472b559
3 changed files with 8 additions and 6 deletions
  1. +6
    -4
      frappe/core/doctype/report/report.py
  2. +1
    -1
      frappe/email/doctype/auto_email_report/auto_email_report.py
  3. +1
    -1
      frappe/templates/emails/auto_email_report.html

+ 6
- 4
frappe/core/doctype/report/report.py View File

@@ -147,10 +147,12 @@ class Report(Document):
limit=limit,
user=user)

meta = frappe.get_meta(self.ref_doctype)

columns = [meta.get_field(c[0]) or frappe._dict(label=meta.get_label(c[0]), fieldname=c[0])
for c in columns]
_columns = []
for column in columns:
meta = frappe.get_meta(column[1])
field = [meta.get_field(column[0]) or frappe._dict(label=meta.get_label(column[0]), fieldname=column[0])]
_columns.extend(field)
columns = _columns

out = out + [list(d) for d in result]



+ 1
- 1
frappe/email/doctype/auto_email_report/auto_email_report.py View File

@@ -103,7 +103,7 @@ class AutoEmailReport(Document):

@staticmethod
def get_spreadsheet_data(columns, data):
out = [[df.label for df in columns], ]
out = [[_(df.label) for df in columns], ]
for row in data:
new_row = []
out.append(new_row)


+ 1
- 1
frappe/templates/emails/auto_email_report.html View File

@@ -20,7 +20,7 @@
<tr>
{% for col in columns %}
<th {{- get_alignment(col) }}>
{{- col.label -}}
{{- _(col.label) -}}
</th>
{% endfor %}
</tr>


Loading…
Cancel
Save