Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
4455 Переглядів

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
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
серп. 22
6505
2
квіт. 22
7987
1
груд. 19
6072
1
лют. 24
1575
0
січ. 21
5316