Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2501 Zobrazení
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
Zrušit
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 Odpovědi Zobrazení Aktivita
1
bře 25
2547
1
čvc 22
4042
0
bře 22
1808
1
pro 23
2660
0
srp 22
2801