[FIX] hr_payroll_account: no company on payroll
When no company is set on the payslip, journal entries of zero are generated. This is because `currency` is empty, therefore `currency.round()` rounds all amounts to zero. We fall back on the company of the journal, since the latter is mandatory. opw-2054781 closes odoo/odoo#35859 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -60,7 +60,7 @@ class HrPayslip(models.Model):
|
||||
debit_sum = 0.0
|
||||
credit_sum = 0.0
|
||||
date = slip.date or slip.date_to
|
||||
currency = slip.company_id.currency_id
|
||||
currency = slip.company_id.currency_id or slip.journal_id.company_id.currency_id
|
||||
|
||||
name = _('Payslip of %s') % (slip.employee_id.name)
|
||||
move_dict = {
|
||||
|
||||
Reference in New Issue
Block a user