Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 22
6474
2
thg 4 22
7939
1
thg 12 19
6038
1
thg 2 24
1531
0
thg 1 21
5086