Skip to Content
Menu
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
Discard
Author

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 Replies Views Activity
1
Mar 25
2446
1
Jul 22
3932
0
Mar 22
1755
1
Dec 23
2547
0
Aug 22
2688