跳至内容
菜单
此问题已终结

I have a report which is showing me a comparison of rfq's on a click of button in web-view . So i already have a controller for the report now i want to download it so should i have a new controller with different url? I am facing a problem with the following code


@http.route('your custom route', methods=['POST', 'GET'], csrf=False, type='http', auth="user", website=True)
def print_id(self, **kw):
record_id = kw['rec_id']
if record_id:
pdf = request.env['report'].sudo().get_pdf([record_id], 'module_name.report_name', data=None)
pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
return request.make_response(pdf, headers=pdfhttpheaders)
else:
return request.redirect('/')
is the rec_id and **kwargs. I dont know what to do with it kindly help or guide me thorugh it
形象
丢弃
相关帖文 回复 查看 活动
1
8月 22
6445
2
4月 22
7875
1
12月 19
5962
1
2月 24
1466
0
1月 21
4965