summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavi Patel <rap@odoo.com>2016-05-31 15:10:12 +0530
committerYannick Tivisse <yti@odoo.com>2016-06-02 14:46:12 +0200
commit9c012ad07e3a47b2189e2dd0ee452bbfb998f5b0 (patch)
tree72a31c7d8389a745d550bcbc9b9e5ca2b52663e0
parenta0b676921bf27c29e2ad727c2cffc1028919fe0b (diff)
[FIX] report: Traceback on print report from wizard.
Go to Product Variant >> Select any Product Variant >> Print Report Of Price List >> select any Price List and Click on print button it's gives traceback like: http://www.awesomescreenshot.com/image/1288867/b6639baf8cb94e3a90ce9d347b3f4f35 Introduced by https://github.com/odoo/odoo/commit/da3d2fb1dc76654e630fba27ca3dcf03002d9431
-rw-r--r--addons/report/controllers/main.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/report/controllers/main.py b/addons/report/controllers/main.py
index 3672cba8020..dc07f97f8cd 100644
--- a/addons/report/controllers/main.py
+++ b/addons/report/controllers/main.py
@@ -104,10 +104,11 @@ class ReportController(Controller):
cr, uid = request.cr, request.uid
report = request.registry['report']._get_report_from_name(cr, uid, reportname)
filename = "%s.%s" % (report.name, "pdf")
- ids = [int(x) for x in docids.split(",")]
- obj = request.env[report.model].browse(ids)
- if report.print_report_name and not len(obj) > 1:
- filename = eval(report.print_report_name, {'object': obj, 'time': time})
+ if docids:
+ ids = [int(x) for x in docids.split(",")]
+ obj = request.env[report.model].browse(ids)
+ if report.print_report_name and not len(obj) > 1:
+ filename = eval(report.print_report_name, {'object': obj, 'time': time})
response.headers.add('Content-Disposition', content_disposition(filename))
response.set_cookie('fileToken', token)
return response