Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] l10n_mx_hr_payroll_account #52

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions l10n_mx_hr_payroll_account/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
**This file is going to be generated by oca-gen-addon-readme.**

*Manual changes will be overwritten.*

Please provide content in the ``readme`` directory:

* **DESCRIPTION.rst** (required)
* INSTALL.rst (optional)
* CONFIGURE.rst (optional)
* **USAGE.rst** (optional, highly recommended)
* DEVELOP.rst (optional)
* ROADMAP.rst (optional)
* HISTORY.rst (optional, recommended)
* **CONTRIBUTORS.rst** (optional, highly recommended)
* CREDITS.rst (optional)

Content of this README will also be drawn from the addon manifest,
from keys such as name, authors, maintainers, development_status,
and license.

A good, one sentence summary in the manifest is also highly recommended.


Automatic changelog generation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`HISTORY.rst` can be auto generated using `towncrier <https://pypi.org/project/towncrier>`_.

Just put towncrier compatible changelog fragments into `readme/newsfragments`
and the changelog file will be automatically generated and updated when a new fragment is added.

Please refer to `towncrier` documentation to know more.

NOTE: the changelog will be automatically generated when using `/ocabot merge $option`.
If you need to run it manually, refer to `OCA/maintainer-tools README <https://github.com/OCA/maintainer-tools>`_.
29 changes: 29 additions & 0 deletions l10n_mx_hr_payroll_account/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2024 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, SUPERUSER_ID

XMLIDS = [
"l10n_mx_hr_payroll.hr_salary_rule_slyn_groceries",
"l10n_mx_hr_payroll.hr_salary_rule_slyn_christmas_bonus",
"l10n_mx_hr_payroll.hr_salary_rule_slyn_liquidaciones_de_savings_fund",
"l10n_mx_hr_payroll.hr_salary_rule_weekly_10000",
"l10n_mx_hr_payroll.hr_salary_rule_weekly_sp_10000",
"l10n_mx_hr_payroll.hr_salary_rule_biweekly_10000",
"l10n_mx_hr_payroll.hr_salary_rule_biweekly_sp_10000",
"l10n_mx_hr_payroll.hr_salary_rule_ptu_sp_10000",
"l10n_mx_hr_payroll.hr_salary_rule_bonus_sp_10000",
]


def _set_account_in_rules(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})

rules = env["hr.salary.rule"]
for xmlid in XMLIDS:
rules += env.ref(xmlid)
rules.write(
{
"account_credit": env.company.account_journal_payment_credit_account_id.id,
}
)
27 changes: 27 additions & 0 deletions l10n_mx_hr_payroll_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "Payroll Account for Mexico",
"icon": "/l10n_mx/static/description/icon.png",
"summary": "Mexican Localization for Payroll Accounts",
"website": "https://github.com/OCA/l10n-mexico",
"author": "Open Source Integrators, "
"Asociacion Mexicana de Odoo (AMOdoo), "
"Odoo Community Association (OCA)",
"category": "Human Resources/Payroll",
"version": "17.0.1.0.0",
"depends": [
# Odoo
"hr_payroll_account",
# Other
"l10n_mx_hr_payroll",
],
"data": [
"data/account.account.csv",
"data/hr.salary.rule.csv",
],
"demo": [],
"installable": True,
"application": False,
"post_init_hook": "_set_account_in_rules",
"license": "LGPL-3",
"development_status": "Beta",
}
11 changes: 11 additions & 0 deletions l10n_mx_hr_payroll_account/data/account.account.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id,name,code,account_type,reconcile
cuenta11_306_000,Subsidio al empleo,11.306.000,asset_current,False
cuenta20_000_000,Pasivo,20.000.000,liability_current,True
cuenta21_601_000,Impuestos ret de ISR x sdos y salarios,21.601.000,liability_current,False
cuenta21_611_000,Retenciones de IMSS a los trabaj,21.611.000,liability_current,False
cuenta60_101_000,Sueldos y salarios,60.101.000,expense,False
cuenta60_103_000,Tiempos extras,60.103.000,expense,False
cuenta60_104_000,Premios de asistencia,60.104.000,expense,False
cuenta60_105_000,Premios de puntualidad,60.105.000,expense,False
cuenta60_115_000,Despensa,60.115.000,expense,False
cuenta60_174_000,Comisiones sobre ventas,60.174.000,expense,False
41 changes: 41 additions & 0 deletions l10n_mx_hr_payroll_account/data/hr.salary.rule.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id,account_debit/id,account_credit/id
l10n_mx_hr_payroll.hr_salary_rule_dpa_groceries,l10n_mx_hr_payroll_account.cuenta60_115_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_slyn_groceries,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_d001_christmas_bonus,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_slyn_christmas_bonus,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_slyn_liquidaciones_de_savings_fund,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_d001_settlement,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_1000,l10n_mx_hr_payroll_account.cuenta60_101_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_1010,l10n_mx_hr_payroll_account.cuenta60_101_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_BP_1015,l10n_mx_hr_payroll_account.cuenta60_105_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_1200,l10n_mx_hr_payroll_account.cuenta60_174_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_1300,l10n_mx_hr_payroll_account.cuenta60_115_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_PA_1400,l10n_mx_hr_payroll_account.cuenta60_104_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_extratime_double,l10n_mx_hr_payroll_account.cuenta60_103_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_extratime_triple,l10n_mx_hr_payroll_account.cuenta60_103_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_SAE,l10n_mx_hr_payroll_account.cuenta11_306_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_ISR_5150,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_5200,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_611_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_10000,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_weekly_sp_SAE,l10n_mx_hr_payroll_account.cuenta11_306_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_sp_isr_5150,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_weekly_sp_10000,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_biweekly_1000,l10n_mx_hr_payroll_account.cuenta60_101_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_1010,l10n_mx_hr_payroll_account.cuenta60_101_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_BP_1015,l10n_mx_hr_payroll_account.cuenta60_105_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_1200,l10n_mx_hr_payroll_account.cuenta60_174_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_1300,l10n_mx_hr_payroll_account.cuenta60_115_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_PA_1400,l10n_mx_hr_payroll_account.cuenta60_104_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_extratime_double,l10n_mx_hr_payroll_account.cuenta60_103_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_extratime_triple,l10n_mx_hr_payroll_account.cuenta60_103_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_SAE,l10n_mx_hr_payroll_account.cuenta11_306_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_ISR_5150,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_5200,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_611_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_10000,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_biweekly_sp_SAE,l10n_mx_hr_payroll_account.cuenta11_306_000,l10n_mx_hr_payroll_account.cuenta20_000_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_sp_isr_5150,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_biweekly_sp_10000,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_ptu_sp_isr_5150,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_ptu_sp_10000,l10n_mx_hr_payroll_account.cuenta20_000_000,
l10n_mx_hr_payroll.hr_salary_rule_bonus_sp_isr_5150,l10n_mx_hr_payroll_account.cuenta20_000_000,l10n_mx_hr_payroll_account.cuenta21_601_000
l10n_mx_hr_payroll.hr_salary_rule_bonus_sp_10000,l10n_mx_hr_payroll_account.cuenta20_000_000,
3 changes: 3 additions & 0 deletions l10n_mx_hr_payroll_account/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Loading