|
@ -35,14 +35,16 @@ class ReportController(report.ReportController): |
|
|
if docids: |
|
|
if docids: |
|
|
obj = request.env[report.model].browse(docids) |
|
|
obj = request.env[report.model].browse(docids) |
|
|
if report.print_report_name and not len(obj) > 1: |
|
|
if report.print_report_name and not len(obj) > 1: |
|
|
report_name = safe_eval(report.print_report_name, |
|
|
|
|
|
{'object': obj, 'time': time}) |
|
|
|
|
|
|
|
|
report_name = safe_eval( |
|
|
|
|
|
report.print_report_name, |
|
|
|
|
|
{'object': obj, 'time': time, 'multi': False}) |
|
|
filename = "%s.%s" % (report_name, "csv") |
|
|
filename = "%s.%s" % (report_name, "csv") |
|
|
# When we print multiple records we still allow a custom |
|
|
# When we print multiple records we still allow a custom |
|
|
# filename. |
|
|
# filename. |
|
|
elif report.print_report_name and len(obj) > 1: |
|
|
elif report.print_report_name and len(obj) > 1: |
|
|
report_name = safe_eval(report.print_report_name, |
|
|
|
|
|
{'objects': obj, 'time': time}) |
|
|
|
|
|
|
|
|
report_name = safe_eval( |
|
|
|
|
|
report.print_report_name, |
|
|
|
|
|
{'objects': obj, 'time': time, 'multi': True}) |
|
|
filename = "%s.%s" % (report_name, "csv") |
|
|
filename = "%s.%s" % (report_name, "csv") |
|
|
csvhttpheaders = [ |
|
|
csvhttpheaders = [ |
|
|
('Content-Type', 'text/csv'), |
|
|
('Content-Type', 'text/csv'), |
|
|