[background-report] minor cleanup

This commit is contained in:
shriharishastry 2018-07-14 18:38:19 +05:30 committed by Prateeksha Singh
parent e0eb3071d9
commit 0a68539c47
3 changed files with 13 additions and 24 deletions

View file

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestChatToken(unittest.TestCase):
pass

View file

@ -168,7 +168,7 @@
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,

View file

@ -265,29 +265,28 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
}
add_prepared_report_buttons(doc) {
if(doc){
this.page.add_inner_button(__("Download Report"), function (){
frappe.call({
method:"frappe.core.doctype.prepared_report.prepared_report.download_attachment",
args: {"dn": flags.name}
});
});
if(doc){
this.page.add_inner_button(__("Download Report"), function () {
frappe.call({
method:"frappe.core.doctype.prepared_report.prepared_report.download_attachment",
args: {"dn": doc.name}
});
});
frappe.route_options = {
report_name: doc.report_name,
filters: doc.filters
};
let filters = JSON.parse(JSON.parse(doc.filters));
this.set_filters(filters);
let filters = JSON.parse(JSON.parse(doc.filters));
this.set_filters(filters);
this.show_status(__(`
<span class="indicator orange">This report was <a href=#Form/Prepared%20Report/${doc.name}>generated</a>
on ${frappe.datetime.convert_to_user_tz(doc.report_end_time)}.
<a href=#List/Prepared%20Report>See all past reports</a>.</span>
`));
}
}
this.page.add_inner_button(__("Generate New Report"), () => {
let mandatory = this.filters.filter(f => f.df.reqd);
@ -311,7 +310,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
});
}
}, "", "primary");
}
}
render_report(data) {
this.columns = this.prepare_columns(data.columns);