Files
suite/l10n_pe_hr_payroll_account/__init__.py
2022-05-10 19:31:47 +00:00

14 lines
604 B
Python

# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from odoo import api, SUPERUSER_ID
from . import models
def _post_install_hook_configure_journals(cr, registry):
"""
This method will create a salary journal for each company and allocate it to each Peru structure.
"""
env = api.Environment(cr, SUPERUSER_ID, {})
companies = env['res.company'].search([('partner_id.country_id', '=', env.ref('base.pe').id)])
for company in companies:
env['account.chart.template']._pe_configure_payroll_account_data(company)