Skip to content
Snippets Groups Projects
Commit 07bec7db authored by lul-odoo's avatar lul-odoo Committed by Yannick Tivisse
Browse files

[FIX] hr_payroll_account: Remove journal_id: False in context

If the wizard to generate payslip was launched without an ´active_id´ in the context.
A ´journal_id´ entry was set to False in the context later leading to a crash at payslip creation.
The crash happens because, at creation time, the journal_id of a ´hr.payslip´ is set to the journal_id
in the context if its present. Since this context entry is False and the journal_id field is required,
creation crashes.
parent ba9b5ce1
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ class HrPayslipEmployees(models.TransientModel):
@api.multi
def compute_sheet(self):
journal_id = False
if self.env.context.get('active_id'):
journal_id = self.env['hr.payslip.run'].browse(self.env.context.get('active_id')).journal_id.id
return super(HrPayslipEmployees, self.with_context(journal_id=journal_id)).compute_sheet()
return super(HrPayslipEmployees, self.with_context(journal_id=journal_id)).compute_sheet()
return super(HrPayslipEmployees, self).compute_sheet()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment