Ir al contenido
Menú
Se marcó esta pregunta
I'm trying to call the payslip of employee by using button, in portal view to allow
the user to download his payslip report. But can't be able facing an error
( KEYERROR: False). Please help me to solve this problem. All of this i'm doing in
web portal form.

Payslip Model:

@http.route(['/employee/payslip/'], type='http', auth="public", website=True)
def portal_my_payslip_report(self, pay_id, access_token=None, report_type=None, download=False, **kw):
try:
payslip_sudo = self._document_check_access('hr.payslip', pay_id, access_token)
except (AccessError, MissingError):
return request.redirect('/my')

if report_type in ('html', 'pdf', 'text'):
return self._show_report(model=payslip_sudo, report_type=report_type, report_ref='hr_payroll.report_payslip', download=download)

values = self._payslip_get_page_view_values(payslip_sudo, access_token, **kw)
return request.render("website_payslip_portal.portal_report_payslip", values)

Payslip_portal_view

\ \ \ id="report_payslip_lang"
\ \ \ t\-attf\-href="/report/pdf/hr_payroll\.report_payslip/\#\{pay\.id\}"
\ \ \ title="Print"\ target="_blank">

Print


Avatar
Descartar
Autor

the view of button is:
<a class="btn btn-secondary btn-block o_print_btn o_portal_payslip_print"
id="report_payslip_lang"
t-attf-href="/report/pdf/hr_payroll.report_payslip/#{pay.id}"
title="Print" target="_blank">
<i class="fa fa-print"/>
Print
</a>

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 25
2415
1
jul 22
3923
0
mar 22
1751
1
dic 23
2526
0
ago 22
2665