Skip to Content
Menú
This question has been flagged
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>

Related Posts Respostes Vistes Activitat
1
de març 25
2490
1
de jul. 22
3955
0
de març 22
1760
1
de des. 23
2583
0
d’ag. 22
2710