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

[16.0][MIG] hr_contract_rate: Migration to 16.0 #1401

Open
wants to merge 24 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ef8d28c
[ADD] hr_contract_rate: flexible wage
alexey-pelykh Mar 8, 2020
90379dc
[UPD] hr_contract_rate: .pot, readme, icon
oca-travis Mar 19, 2020
5f7babf
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 4, 2020
25ab44b
[REF] hr_contract_rate: Black python code
Jan 5, 2021
1cc53b4
[MIG] hr_contract_rate: Migration to 13.0
Jan 5, 2021
15c60f8
[UPD] Update hr_contract_rate.pot
oca-travis Jan 12, 2021
a294f4b
[UPD] README.rst
OCA-git-bot Jan 12, 2021
820f1fe
Added translation using Weblate (French (France))
sanrav Mar 19, 2021
e590139
Translated using Weblate (French (France))
sanrav Mar 19, 2021
2e6a3d4
[IMP] hr_contract_rate: black, isort, prettier
nimarosa Mar 20, 2023
31b97f8
[14.0] [MIG] hr_contract_rate
nimarosa Mar 20, 2023
843c3aa
[UPD] Update hr_contract_rate.pot
Mar 20, 2023
959c8bb
[UPD] README.rst
OCA-git-bot Mar 20, 2023
4b67eec
Added translation using Weblate (Spanish (Argentina))
nimarosa Apr 2, 2023
b37e8a4
Translated using Weblate (Spanish (Argentina))
nimarosa Apr 2, 2023
8c7edbe
Added translation using Weblate (Italian)
mymage May 18, 2023
851fdfd
Translated using Weblate (Italian)
mymage May 30, 2023
9113525
[UPD] README.rst
OCA-git-bot Sep 3, 2023
d10bf6b
Update translation files
weblate Oct 9, 2023
24864db
Added translation using Weblate (Spanish)
Ivorra78 Feb 16, 2024
9b1c125
Translated using Weblate (Spanish)
Ivorra78 Feb 16, 2024
daddc95
Translated using Weblate (Spanish)
Ivorra78 Feb 16, 2024
78fce3d
[IMP] hr_contract_rate: pre-commit stuff
ntsirintanis Nov 7, 2024
350aac0
[MIG] hr_contract_rate: Migration to 16.0
ntsirintanis Nov 7, 2024
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
99 changes: 99 additions & 0 deletions hr_contract_rate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
================
HR Contract Rate
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:633c9cebd405948bd6e70d276863b2046c939088fbb41a52061bd92a61e3da44
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/16.0/hr_contract_rate
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_contract_rate
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to specify a contractual rate of Employee using various
time periods:

* Hour
* Day
* Week
* Month
* Quarter
* Year

It's possible to specify number of hours/days/weeks per month for wage
calculation for the contract.

**Table of contents**

.. contents::
:local:

Usage
=====

Since hourly, daily, and weekly rates are not tranformable to monthly wage with
precision, ``wage`` is being set to zero in these cases. An extra ``approximate_wage``
field is added to store approximately computed average monthly wage. It's also
important to review payroll calculation rules.

This module is based on different approach than ``hr_contract_hourly_rate`` use.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_contract_rate%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* CorporateHub

Contributors
~~~~~~~~~~~~

* `CorporateHub <https://corporatehub.eu/>`__

* Alexey Pelykh <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/16.0/hr_contract_rate>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions hr_contract_rate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from .hooks import pre_init_hook, post_init_hook
20 changes: 20 additions & 0 deletions hr_contract_rate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2020 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2020 CorporateHub (https://corporatehub.eu)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "HR Contract Rate",
"version": "16.0.1.0.0",
"category": "Human Resources",
"website": "https://github.com/OCA/hr",
"author": "CorporateHub, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"application": False,
"summary": "Employee's contract rate and period",
"pre_init_hook": "pre_init_hook",
"post_init_hook": "post_init_hook",
"depends": ["hr_contract"],
"data": ["views/hr_contract.xml"],
"mantainers": ["nimarosa"],
}
30 changes: 30 additions & 0 deletions hr_contract_rate/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2020 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import SUPERUSER_ID, api


def pre_init_hook(cr):
cr.execute(
"""
ALTER TABLE hr_contract
ADD amount numeric;
COMMENT
ON COLUMN hr_contract.amount
IS 'Amount';
ALTER TABLE hr_contract
ADD amount_period varchar;
COMMENT
ON COLUMN hr_contract.amount_period
IS 'Period of Amount';
UPDATE hr_contract
SET amount = wage, amount_period = 'month';
"""
)


def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
contracts = env["hr.contract"].search([])
contracts._inverse_wage()
contracts._compute_wage()
148 changes: 148 additions & 0 deletions hr_contract_rate/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_contract_rate
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-16 23:55+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__amount
#: model_terms:ir.ui.view,arch_db:hr_contract_rate.hr_contract_view_form
msgid "Amount"
msgstr "Importe"

#. module: hr_contract_rate
#: model:ir.model.fields.selection,name:hr_contract_rate.selection__hr_contract__amount_period__day
msgid "Day"
msgstr "Día"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__display_name
msgid "Display Name"
msgstr "Nombre a Mostrar"

#. module: hr_contract_rate
#: model:ir.model,name:hr_contract_rate.model_hr_contract
msgid "Employee Contract"
msgstr "Contrato de Empleado"

#. module: hr_contract_rate
#: model:ir.model.fields,help:hr_contract_rate.field_hr_contract__amount
msgid "Employee's contract amount per period"
msgstr "Importe del contrato del trabajador por período"

#. module: hr_contract_rate
#: model:ir.model.fields,help:hr_contract_rate.field_hr_contract__approximate_wage
msgid "Employee's monthly gross wage (approximate)"
msgstr "Salario bruto mensual del trabajador (aproximado)"

#. module: hr_contract_rate
#: model:ir.model.fields,help:hr_contract_rate.field_hr_contract__wage
msgid "Employee's monthly gross wage."
msgstr "Salario bruto mensual del trabajador."

#. module: hr_contract_rate
#: model:ir.model.fields.selection,name:hr_contract_rate.selection__hr_contract__amount_period__hour
msgid "Hour"
msgstr "Hora"

#. module: hr_contract_rate
#: model:ir.model.fields,help:hr_contract_rate.field_hr_contract__work_days_per_month
msgid "How many work days there is in an average month"
msgstr "Cuántos días laborables hay en un mes medio"

#. module: hr_contract_rate
#: model:ir.model.fields,help:hr_contract_rate.field_hr_contract__work_hours_per_month
msgid "How many work hours there is in an average month"
msgstr "Cuántas horas de trabajo hay en un mes medio"

#. module: hr_contract_rate
#: model:ir.model.fields,help:hr_contract_rate.field_hr_contract__work_weeks_per_month
msgid "How many work weeks there is in an average month"
msgstr "Cuántas semanas de trabajo hay en un mes medio"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__id
msgid "ID"
msgstr "ID"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__is_wage_accurate
msgid "Is Wage Accurate"
msgstr "El Salario es Exacto"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#. module: hr_contract_rate
#: model:ir.model.fields.selection,name:hr_contract_rate.selection__hr_contract__amount_period__month
msgid "Month"
msgstr "Mes"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__amount_period
msgid "Period of Amount"
msgstr "Período de Importe"

#. module: hr_contract_rate
#: model:ir.model.fields,help:hr_contract_rate.field_hr_contract__amount_period
msgid "Period of employee's contract amount"
msgstr "Periodo de duración del contrato del empleado"

#. module: hr_contract_rate
#: model:ir.model.fields.selection,name:hr_contract_rate.selection__hr_contract__amount_period__quarter
msgid "Quarter"
msgstr "Trimestre"

#. module: hr_contract_rate
#: model_terms:ir.ui.view,arch_db:hr_contract_rate.hr_contract_view_form
msgid "Salary and Advantages"
msgstr "Salario y Ventajas"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__wage
msgid "Wage"
msgstr "Salario"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__approximate_wage
msgid "Wage (approximate)"
msgstr "Salario (aproximado)"

#. module: hr_contract_rate
#: model:ir.model.fields.selection,name:hr_contract_rate.selection__hr_contract__amount_period__week
msgid "Week"
msgstr "Semana"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__work_days_per_month
msgid "Work days (per month)"
msgstr "Días laborables (por mes)"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__work_hours_per_month
msgid "Work hours (per month)"
msgstr "Horas de trabajo (por mes)"

#. module: hr_contract_rate
#: model:ir.model.fields,field_description:hr_contract_rate.field_hr_contract__work_weeks_per_month
msgid "Work weeks (per month)"
msgstr "Semanas de trabajo (por mes)"

#. module: hr_contract_rate
#: model:ir.model.fields.selection,name:hr_contract_rate.selection__hr_contract__amount_period__year
msgid "Year"
msgstr "Año"
Loading
Loading