ソースを参照

Merge pull request #3515 from manassolanki/profit-loss-report

Add the empty row in the excel report, fixes #9377
version-14
Makarand Bauskar 8年前
committed by GitHub
コミット
214e9a194a
2個のファイルの変更6行の追加7行の削除
  1. +5
    -6
      frappe/desk/query_report.py
  2. +1
    -1
      frappe/public/js/frappe/views/reports/query_report.js

+ 5
- 6
frappe/desk/query_report.py ファイルの表示

@@ -146,18 +146,17 @@ def export_query():
# build table from dict
if isinstance(data.result[0], dict):
for row in data.result:
if row:
for i,row in enumerate(data.result):
# only rows which are visible in the report
if row and (i+1 in visible_idx):
row_list = []
for idx in range(len(data.columns)):
row_list.append(row.get(columns[idx]["fieldname"],""))
result.append(row_list)
elif not row:
result.append([])
else:
result = result + data.result
# filter rows by slickgrid's inline filter
if visible_idx:
result = [x for idx, x in enumerate(result) if idx == 0 or idx in visible_idx]

from frappe.utils.xlsxutils import make_xlsx
xlsx_file = make_xlsx(result, "Query Report")


+ 1
- 1
frappe/public/js/frappe/views/reports/query_report.js ファイルの表示

@@ -827,7 +827,7 @@ frappe.views.QueryReport = Class.extend({
var view_data = frappe.slickgrid_tools.get_view_data(me.columns, me.dataView);
var result = view_data.map(row => row.splice(1));

// rows filtered by inline_filter of slickgrid
// to download only visible rows
var visible_idx = view_data.map(row => row[0]).filter(sr_no => sr_no !== 'Sr No');

if (data.file_format_type == "CSV") {


読み込み中…
キャンセル
保存