mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX] l10n_pe_hr_payroll_account: default account field in 15
This commit is contained in:
@@ -96,10 +96,8 @@ class AccountChartTemplate(models.Model):
|
||||
('company_id', '=', company.id),
|
||||
])
|
||||
if journal:
|
||||
if not journal.default_credit_account_id:
|
||||
journal.default_credit_account_id = accounts[exp_salary].id
|
||||
if not journal.default_debit_account_id:
|
||||
journal.default_debit_account_id = accounts[exp_salary].id
|
||||
if not journal.default_account_id:
|
||||
journal.default_account_id = accounts[exp_salary].id
|
||||
if hasattr(journal, 'payroll_entry_type'):
|
||||
journal.payroll_entry_type = 'grouped'
|
||||
else:
|
||||
@@ -108,19 +106,16 @@ class AccountChartTemplate(models.Model):
|
||||
'code': 'PAYR',
|
||||
'type': 'general',
|
||||
'company_id': company.id,
|
||||
'default_credit_account_id': accounts[exp_salary].id,
|
||||
'default_debit_account_id': accounts[exp_salary].id,
|
||||
'default_account_id': accounts[exp_salary].id,
|
||||
})
|
||||
if hasattr(journal, 'payroll_entry_type'):
|
||||
journal.payroll_entry_type = 'grouped'
|
||||
|
||||
self.env['ir.property'].create([{
|
||||
'name': 'structure_journal_id',
|
||||
'company_id': company.id,
|
||||
'fields_id': journal_field_id.id,
|
||||
'value_reference': 'account.journal,%s' % journal.id,
|
||||
'res_id': 'hr.payroll.structure,%s' % structure.id,
|
||||
} for structure in pe_structures])
|
||||
self.env['ir.property']._set_multi(
|
||||
"journal_id",
|
||||
"hr.payroll.structure",
|
||||
{structure.id: journal for structure in pe_structures},
|
||||
)
|
||||
|
||||
# Find rules and set accounts on them.
|
||||
# Find all rules that are ...
|
||||
|
||||
Reference in New Issue
Block a user