瀏覽代碼

Merge pull request #4095 from mbauskar/childtable-columns

[minor] show the child table fields lable in Auto Email Report
version-14
Rushabh Mehta 7 年之前
committed by GitHub
父節點
當前提交
13f472b559
共有 3 個檔案被更改,包括 8 行新增6 行删除
  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 查看文件

@@ -147,10 +147,12 @@ class Report(Document):
limit=limit, limit=limit,
user=user) 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] out = out + [list(d) for d in result]




+ 1
- 1
frappe/email/doctype/auto_email_report/auto_email_report.py 查看文件

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


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


+ 1
- 1
frappe/templates/emails/auto_email_report.html 查看文件

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


Loading…
取消
儲存