diff --git a/l10n_us_hr_payroll_account/__manifest__.py b/l10n_us_hr_payroll_account/__manifest__.py index d0443654..b9a206b2 100644 --- a/l10n_us_hr_payroll_account/__manifest__.py +++ b/l10n_us_hr_payroll_account/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'United States of America - Payroll with Accounting', 'author': 'Hibou Corp. ', - 'version': '13.0.2019.0.0', + 'version': '14.0.2020.0.0', 'category': 'Human Resources', 'depends': [ 'l10n_us_hr_payroll', diff --git a/l10n_us_hr_payroll_account/models/account_chart_template.py b/l10n_us_hr_payroll_account/models/account_chart_template.py index 16232431..fe3cbbb7 100644 --- a/l10n_us_hr_payroll_account/models/account_chart_template.py +++ b/l10n_us_hr_payroll_account/models/account_chart_template.py @@ -69,10 +69,8 @@ class AccountChartTemplate(models.Model): ('company_id', '=', company.id), ]) if journal: - if not journal.default_credit_account_id: - journal.default_credit_account_id = accounts[SALARY_EXPENSES].id - if not journal.default_debit_account_id: - journal.default_debit_account_id = accounts[SALARY_EXPENSES].id + if not journal.default_account_id: + journal.default_account_id = accounts[SALARY_EXPENSES].id if hasattr(journal, 'payroll_entry_type'): journal.payroll_entry_type = 'grouped' else: @@ -81,19 +79,16 @@ class AccountChartTemplate(models.Model): 'code': 'PAYR', 'type': 'general', 'company_id': company.id, - 'default_credit_account_id': accounts[SALARY_EXPENSES].id, - 'default_debit_account_id': accounts[SALARY_EXPENSES].id, + 'default_account_id': accounts[SALARY_EXPENSES].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 us_structures]) + self.env['ir.property']._set_multi( + "journal_id", + "hr.payroll.structure", + {structure.id: journal for structure in us_structures}, + ) # Find rules and set accounts on them. # Find all rules that are ...