Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
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


Awatar
Odrzuć
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>

Powiązane posty Odpowiedzi Widoki Czynność
1
mar 25
2547
1
lip 22
4042
0
mar 22
1808
1
gru 23
2660
0
sie 22
2801