diff --git a/l10n_us_hr_payroll_account/__init__.py b/l10n_us_hr_payroll_account/__init__.py deleted file mode 100644 index 6412a7a0..00000000 --- a/l10n_us_hr_payroll_account/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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 USA structure. - """ - env = api.Environment(cr, SUPERUSER_ID, {}) - companies = env['res.company'].search([('partner_id.country_id', '=', env.ref('base.us').id)]) - for company in companies: - env['account.chart.template']._us_configure_payroll_account_data(company) diff --git a/l10n_us_hr_payroll_account/__manifest__.py b/l10n_us_hr_payroll_account/__manifest__.py deleted file mode 100644 index bca376f1..00000000 --- a/l10n_us_hr_payroll_account/__manifest__.py +++ /dev/null @@ -1,26 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -{ - 'name': 'United States of America - Payroll with Accounting', - 'author': 'Hibou Corp. ', - 'version': '15.0.2021.0.0', - 'category': 'Human Resources', - 'depends': [ - 'l10n_us_hr_payroll', - 'hr_payroll_account', - 'l10n_generic_coa', - ], - 'description': """ -Accounting Data for USA Payroll Rules. -====================================== - """, - 'auto_install': True, - 'data': [ - 'data/l10n_us_hr_payroll_account_data.xml', - ], - 'demo': [ - 'data/l10n_us_hr_payroll_account_demo.xml', - ], - 'post_init_hook': '_post_install_hook_configure_journals', - 'license': 'OPL-1', -} diff --git a/l10n_us_hr_payroll_account/data/l10n_us_hr_payroll_account_data.xml b/l10n_us_hr_payroll_account/data/l10n_us_hr_payroll_account_data.xml deleted file mode 100644 index 94aa5427..00000000 --- a/l10n_us_hr_payroll_account/data/l10n_us_hr_payroll_account_data.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - US Default Accounting - - - code - - if records: - companies = env.user.company_ids - # You can override the account codes with kwargs like - # ap_code='2111', salary_exp_code='6111' - env['account.chart.template']._us_configure_payroll_account_data(companies, salary_rules=records, full_reset=False) - - - - - US Default Accounting (Reset) - - - code - - if records: - companies = env.user.company_ids - # You can override the account codes with kwargs like - # ap_code='2111', salary_exp_code='6111' - env['account.chart.template']._us_configure_payroll_account_data(companies, salary_rules=records, full_reset=True) - - - - - diff --git a/l10n_us_hr_payroll_account/data/l10n_us_hr_payroll_account_demo.xml b/l10n_us_hr_payroll_account/data/l10n_us_hr_payroll_account_demo.xml deleted file mode 100644 index e6093d7e..00000000 --- a/l10n_us_hr_payroll_account/data/l10n_us_hr_payroll_account_demo.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/l10n_us_hr_payroll_account/i18n/es.po b/l10n_us_hr_payroll_account/i18n/es.po deleted file mode 100644 index cff71d2b..00000000 --- a/l10n_us_hr_payroll_account/i18n/es.po +++ /dev/null @@ -1,31 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * l10n_us_hr_payroll_account -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 15.0+e\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-12 01:35+0000\n" -"PO-Revision-Date: 2021-10-12 01:35+0000\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: l10n_us_hr_payroll_account -#: model:ir.model,name:l10n_us_hr_payroll_account.model_account_chart_template -msgid "Account Chart Template" -msgstr "Plantilla de la Tabla de Cuentas" - -#. module: l10n_us_hr_payroll_account -#: model:ir.actions.server,name:l10n_us_hr_payroll_account.action_us_salary_rule_account_set -msgid "US Default Accounting" -msgstr "Contabilidad Predeterminada de EE.UU" - -#. module: l10n_us_hr_payroll_account -#: model:ir.actions.server,name:l10n_us_hr_payroll_account.action_us_salary_rule_account_reset -msgid "US Default Accounting (Reset)" -msgstr "Contabilidad Predeterminada de EE.UU (Restablecer)" diff --git a/l10n_us_hr_payroll_account/models/__init__.py b/l10n_us_hr_payroll_account/models/__init__.py deleted file mode 100644 index 21f7d3d7..00000000 --- a/l10n_us_hr_payroll_account/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from . import account_chart_template diff --git a/l10n_us_hr_payroll_account/models/account_chart_template.py b/l10n_us_hr_payroll_account/models/account_chart_template.py deleted file mode 100644 index 921a35b1..00000000 --- a/l10n_us_hr_payroll_account/models/account_chart_template.py +++ /dev/null @@ -1,105 +0,0 @@ -# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details. - -from odoo import models - -ACCOUNT_PAYABLE = '211000' -SALARY_EXPENSES = '630000' - - -class AccountChartTemplate(models.Model): - _inherit = 'account.chart.template' - - def _load(self, sale_tax_rate, purchase_tax_rate, company): - """ - Override to configure payroll accounting data as well as accounting data. - """ - res = super()._load(sale_tax_rate, purchase_tax_rate, company) - self._us_configure_payroll_account_data(company) - return res - - def _us_configure_payroll_account_data(self, companies, ap_code=ACCOUNT_PAYABLE, salary_exp_code=SALARY_EXPENSES, - salary_rules=None, full_reset=False): - account_codes = ( - ap_code, - salary_exp_code, - ) - us_structures = self.env['hr.payroll.structure'].search([('country_id', '=', self.env.ref('base.us').id)]) - journal_field_id = self.env['ir.model.fields'].search([ - ('model', '=', 'hr.payroll.structure'), - ('name', '=', 'journal_id')], limit=1) - - for company in companies: - self = self.with_context({'allowed_company_ids': company.ids}) - accounts = { - code: self.env['account.account'].search( - [('company_id', '=', company.id), ('code', '=like', '%s%%' % code)], limit=1) - for code in account_codes - } - accounts['none'] = self.env['account.account'].browse() - - def set_rule_accounts(code, account_debit, account_credit): - rule_domain = [ - ('struct_id', 'in', us_structures.ids), - ('code', '=like', code), - ] - if salary_rules: - rule_domain.append(('id', 'in', salary_rules.ids)) - rules = self.env['hr.salary.rule'].search(rule_domain) - if full_reset: - values = { - 'account_debit': account_debit.id, - 'account_credit': account_credit.id, - } - rules.write(values) - else: - # we need to ensure we do not update an account that is already set - for rule in rules: - values = {} - if account_debit and not rule.account_debit: - values['account_debit'] = account_debit.id - if account_credit and not rule.account_credit: - values['account_credit'] = account_credit.id - if values: - # save a write if no values to write - rule.write(values) - - journal = self.env['account.journal'].search([ - ('code', '=', 'PAYR'), - ('name', '=', 'Payroll'), - ('company_id', '=', company.id), - ]) - if journal: - if not journal.default_account_id: - journal.default_account_id = accounts[salary_exp_code].id - if hasattr(journal, 'payroll_entry_type'): - journal.payroll_entry_type = 'grouped' - else: - journal = self.env['account.journal'].create({ - 'name': 'Payroll', - 'code': 'PAYR', - 'type': 'general', - 'company_id': company.id, - 'default_account_id': accounts[salary_exp_code].id, - }) - if hasattr(journal, 'payroll_entry_type'): - journal.payroll_entry_type = 'grouped' - - 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 ... - - # BASIC* -> SALARY_EXPENSE debit account - set_rule_accounts('BASIC%', accounts[salary_exp_code], accounts['none']) - # ALW* -> SALARY_EXPENSE debit account - set_rule_accounts('ALW%', accounts[salary_exp_code], accounts['none']) - # EE_* -> AP debit - set_rule_accounts('EE_%', accounts[ap_code], accounts['none']) - # ER_* -> AP debit, SE credit - set_rule_accounts('ER_%', accounts[ap_code], accounts[salary_exp_code]) - # NET* -> AP credit - set_rule_accounts('NET%', accounts['none'], accounts[ap_code]) diff --git a/l10n_us_hr_payroll_account/static/description/icon.png b/l10n_us_hr_payroll_account/static/description/icon.png deleted file mode 100644 index 8ac2e2aa..00000000 Binary files a/l10n_us_hr_payroll_account/static/description/icon.png and /dev/null differ