Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5bac97b
[ADD] hr_contract_rate: flexible wage
alexey-pelykh Mar 8, 2020
6b32668
[UPD] hr_contract_rate: .pot, readme, icon
oca-travis Mar 19, 2020
a41a6e7
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 4, 2020
349acc3
[REF] hr_contract_rate: Black python code
Jan 5, 2021
3a8b074
[MIG] hr_contract_rate: Migration to 13.0
Jan 5, 2021
bed2b46
[UPD] Update hr_contract_rate.pot
oca-travis Jan 12, 2021
a57109a
[UPD] README.rst
OCA-git-bot Jan 12, 2021
a33d36d
Added translation using Weblate (French (France))
sanrav Mar 19, 2021
d8a13ae
Translated using Weblate (French (France))
sanrav Mar 19, 2021
6ce7e32
[IMP] hr_contract_rate: black, isort, prettier
nimarosa Mar 20, 2023
6542575
[14.0] [MIG] hr_contract_rate
nimarosa Mar 20, 2023
95f190c
[UPD] Update hr_contract_rate.pot
Mar 20, 2023
556cb82
[UPD] README.rst
OCA-git-bot Mar 20, 2023
8d57fc8
Added translation using Weblate (Spanish (Argentina))
nimarosa Apr 2, 2023
9d9197b
Translated using Weblate (Spanish (Argentina))
nimarosa Apr 2, 2023
b50f3d1
Added translation using Weblate (Italian)
mymage May 18, 2023
1c76c23
Translated using Weblate (Italian)
mymage May 30, 2023
d624c33
[UPD] README.rst
OCA-git-bot Sep 3, 2023
553fcb1
Update translation files
weblate Oct 9, 2023
9e506c7
Added translation using Weblate (Spanish)
Ivorra78 Feb 16, 2024
f08e640
Translated using Weblate (Spanish)
Ivorra78 Feb 16, 2024
cca78c6
Translated using Weblate (Spanish)
Ivorra78 Feb 16, 2024
6739a38
[IMP] hr_contract_rate: pre-commit auto fixes
nimarosa Oct 5, 2026
456932d
[MIG] hr_contract_rate: Migration to 18.0
nimarosa Oct 5, 2026
4e344a9
[FIX] hr_contract_rate: refresh the approximate wage when the wage is…
nimarosa Oct 5, 2026
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
122 changes: 122 additions & 0 deletions hr_contract_rate/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
================
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/18.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-18-0/hr-18-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=18.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
=====

On the contract form, the *Wage* box becomes a *Rate*: an amount and the
period it is quoted in.

Since hourly, daily, and weekly rates are not transformable 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, using the number of work hours, days or
weeks per month set on the contract. It's also important to review
payroll calculation rules.

Writing ``wage`` directly keeps working: it stores a monthly amount.
Modules that write ``wage`` as a by-product and must not reset the rate
can pass ``hr_contract_inverse_wage_skip`` in the context.

When the module is installed on a database that already has contracts,
their current wage is kept as a monthly amount.

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:%2018.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 <alexey.pelykh@corphub.eu>

- Nimarosa <https://github.com/nimarosa>

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.

.. |maintainer-nimarosa| image:: https://github.com/nimarosa.png?size=40px
:target: https://github.com/nimarosa
:alt: nimarosa

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-nimarosa|

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/18.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
24 changes: 24 additions & 0 deletions hr_contract_rate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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": "18.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",
"depends": ["hr_contract"],
"data": ["views/hr_contract_views.xml"],
"assets": {
"web.assets_backend": [
"hr_contract_rate/static/src/scss/hr_contract_rate.scss",
],
},
"maintainers": ["nimarosa"],
}
21 changes: 21 additions & 0 deletions hr_contract_rate/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).


def pre_init_hook(env):
"""Seed the rate of the existing contracts from their current wage.

``wage`` becomes a stored computed field derived from ``amount`` and
``amount_period``. Without this, installing the module on a database that
already holds contracts would compute every wage from an empty amount and
zero it. An amount that is already there always wins.
"""
env.cr.execute(
"""
ALTER TABLE hr_contract ADD COLUMN IF NOT EXISTS amount numeric;
ALTER TABLE hr_contract ADD COLUMN IF NOT EXISTS amount_period varchar;
UPDATE hr_contract
SET amount = wage, amount_period = 'month'
WHERE amount IS NULL;
"""
)
152 changes: 152 additions & 0 deletions hr_contract_rate/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# 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 <informatica@totmaterial.es>\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
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 "Rate"
msgstr "Tarifa"

#. 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