RFQ: Rename payroll models to a dedicated namespace for 20.0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Read the payroll models and wizards that declare the listed hr.* names, along with their references across the module. The proposal is to move those collisions to the payroll.* namespace as part of the 20.0 migration; first resolve the open namespace and migration questions with maintainers. Done means the renamed models and references coexist with Enterprise hr_payroll without merging models or tables.
Written by the indexing model from the issue text.
Description
Proposal: Rename payroll models to a dedicated namespace for 20.0
TL;DR — Rename the module's models from hr.* to a dedicated payroll.*
namespace (e.g. hr.payslip → payroll.payslip) so the OCA payroll engine can
coexist on a database that also has the Enterprise hr_payroll module
installed. Version 20.0 is the right moment: there is no 20.0 port yet, so the
rename can ride along with the migration instead of being a follow-up breaking
change.
Background
This module descends from the last community hr_payroll (v14) and kept the
historical model names (hr.payslip, hr.salary.rule, ...). Odoo's Enterprise
hr_payroll module defines models with the exact same names:
| Model | In OCA payroll |
In Enterprise hr_payroll |
|---|---|---|
hr.payslip |
yes | yes |
hr.payslip.line |
yes | yes |
hr.payslip.input |
yes | yes |
hr.payslip.run |
yes | yes |
hr.payslip.worked_days |
yes | yes |
hr.salary.rule |
yes | yes |
hr.salary.rule.category |
yes | yes |
hr.payroll.structure |
yes | yes |
When two modules declare the same _name, Odoo merges them into a single model
and table. Today, installing payroll on an Enterprise database does not fail —
it silently produces a franken-model:
- Conflicting
statemachines: OCA usesdraft/verify/done/cancel,
Enterprise usesdraft/validated/paid/cancel. Selections merge; workflows
don't. - Method collisions:
compute_sheet,refund_sheet,
action_payslip_done,get_worked_day_lines,_get_payslip_lines,
get_salary_line_total, ... exist in both engines. Since neither module
depends on the other, load order is not deterministic — whichever loads last
silently wins. - Field-type clashes:
nameis a plainCharhere vs computed there;
lineamount/totalareFloatvsMonetary;appears_on_payslipis
BooleanvsSelection;category_id(m2o) vscategory_ids(m2m);
contract_idvsversion_id(both →hr.version, different columns). - Divergent engines: OCA computes worked days from attendances/leaves;
Enterprise requireshr.work.entry.type. OCA has contribution registers,
hr.rule.input, range conditions and parent/child rules — none of which
exist in Enterprise.
The result is an installation that "works" at install time but is broken in
practice — and every OCA payslip lands in the hr_payslip table, i.e. inside
the Enterprise payroll surface (including its per-employee licensing scope),
even for companies that only intend to use the community engine.
Proposal
Rename all model names that collide with hr_payroll to a dedicated
payroll.* namespace, matching the module's technical name:
Current _name |
Proposed _name |
New table |
|---|---|---|
hr.payslip |
payroll.payslip |
payroll_payslip |
hr.payslip.line |
payroll.payslip.line |
payroll_payslip_line |
hr.payslip.input |
payroll.payslip.input |
payroll_payslip_input |
hr.payslip.run |
payroll.payslip.run |
payroll_payslip_run |
hr.payslip.worked_days |
payroll.payslip.worked_days |
payroll_payslip_worked_days |
hr.salary.rule |
payroll.salary.rule |
payroll_salary_rule |
hr.salary.rule.category |
payroll.salary.rule.category |
payroll_salary_rule_category |
hr.payroll.structure |
payroll.structure |
payroll_structure |
hr.contribution.register |
payroll.contribution.register |
payroll_contribution_register |
hr.rule.input |
payroll.rule.input |
payroll_rule_input |
hr.payslip.employees (wizard) |
payroll.payslip.employees |
— |
hr.payslip.change.state (wizard) |
payroll.payslip.change.state |
— |
payslip.lines.contribution.register (wizard) |
payroll.lines.contribution.register |
— |
report.payroll.* abstracts |
unchanged (already namespaced) | — |
Benefits
- Coexistence: OCA and Enterprise engines can run side by side — e.g.
different companies in the same database using different engines — with
deterministic behavior and zero schema merging. - Independent evolution: the OCA engine keeps features Enterprise lacks
(contribution registers, rule inputs, range conditions, parent/child rules
and lines) without grafting onto a schema Odoo SA changes every release. - Clean scope: OCA payslips stay in OCA tables. Deployments using only
the community engine don't createhr.paysliprecords, keeping the
Enterprise payroll surface (and its associated licensing) untouched for
deployments that don't need it. - Works identically with or without
hr_payrollinstalled — no
runtime detection or delegation hacks.
Open questions
- Namespace choice:
payroll.*(module name, proposed here) vs another
prefix? - Any objection to landing this as part of the 20.0 migration?
- Dominant language
- Python
- Stars
- 124
- Forks
- 202
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OCA/payroll
-
help wanted no stale work in progress
Difficulty 4/5 3-5 days Newbie friendliness 48/100
OCA/payroll#314 · 2 comments ·
Maintainers usually reply within 1 day
-
help wanted no stale work in progress
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
help wanted no stale work in progress
Difficulty 5/5 Over a week Newbie friendliness 15/100
OCA/payroll#169 · 2 comments ·
Maintainers usually reply within 1 day
-
help wanted no stale work in progress
Difficulty 5/5 Over a week Newbie friendliness 25/100
OCA/payroll#135 · 5 comments ·
Maintainers usually reply within 1 day
-
help wanted no stale work in progress
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
documentation type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
add entry to blockOpen
Difficulty 1/5 Under an hour Newbie friendliness 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Possibly taken @0z5a claimed this today. Openneeds-triage
Difficulty 2/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
trace: Pi's 1-hour cache writes are priced at 1.25x, but billed at 2xPossibly taken @Shizoqua claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/TokenEconomizer#221 ·
Maintainers usually reply within 1 day
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days