Skip to content

[18.0][MIG] hr_contract_rate: Migration to 18.0 - #1629

Open
nimarosa wants to merge 25 commits into
OCA:18.0from
nimarosa:18.0-mig-hr_contract_rate
Open

nimarosa wants to merge 25 commits into
OCA:18.0from
nimarosa:18.0-mig-hr_contract_rate

Conversation

@nimarosa

@nimarosa nimarosa commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Migration of hr_contract_rate to 18.0 from 14.0 (it was not ported to 15.0-17.0, and #1401 for 16.0 was closed).

Standard migration, module history preserved. Main changes:

  • Hooks adapted to env. post_init_hook removed, the ORM already computes the stored fields on install.
  • Contract form adapted to the 18.0 layout (amount and period on one line, in place of the wage box).
  • track_visibility -> tracking.
  • AMOUNT_PERIOD_SELECTION exported so other modules can reuse the keys.
  • Separate [FIX] commit: writing wage on an hourly/daily/weekly contract left approximate_wage outdated.

I'm using it in production.

@OCA/hr-maintainers

alexey-pelykh and others added 25 commits October 5, 2026 19:19
Currently translated at 47.8% (11 of 23 strings)

Translation: hr-13.0/hr-13.0-hr_contract_rate
Translate-URL: https://translation.odoo-community.org/projects/hr-13-0/hr-13-0-hr_contract_rate/fr_FR/
Currently translated at 100.0% (26 of 26 strings)

Translation: hr-14.0/hr-14.0-hr_contract_rate
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_contract_rate/es_AR/
Currently translated at 100.0% (26 of 26 strings)

Translation: hr-14.0/hr-14.0-hr_contract_rate
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_contract_rate/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: hr-14.0/hr-14.0-hr_contract_rate
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_contract_rate/
Currently translated at 15.3% (4 of 26 strings)

Translation: hr-14.0/hr-14.0-hr_contract_rate
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_contract_rate/es/
Currently translated at 100.0% (26 of 26 strings)

Translation: hr-14.0/hr-14.0-hr_contract_rate
Translate-URL: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_contract_rate/es/
Ported from 14.0, the last series the module exists in.

- Install hooks take ``env``. ``pre_init_hook`` only seeds contracts that
  have no amount yet; ``post_init_hook`` is gone: the ORM computes the new
  stored fields of the existing contracts by itself, and calling
  ``_compute_wage()`` outside of a compute went through the inverse of
  ``wage``.
- The contract form of 18.0 lays the wage out differently: amount and
  period now replace the wage box on one line, sized by a small stylesheet.
- ``AMOUNT_PERIOD_SELECTION`` is exported so other models can share the
  keys of ``amount_period``.
- Tests cover every period, the inverse of ``wage`` and the form view.
… written

The fields computed together with ``wage`` are protected from
recomputation while it is being written, so writing a wage on an hourly,
daily or weekly contract stored the monthly amount but left
``approximate_wage`` and ``is_wage_accurate`` describing the old rate.
@OCA-git-bot OCA-git-bot added series:18.0 mod:hr_contract_rate Module hr_contract_rate labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants