← Back to Pull requests

[20.0][REF] payroll: rename models to the payroll.* namespace #325

Open
dreispt opened this pull request with 180317 lines diff across 142 files
View on GitHub
dreispt dreispt commented on Nov 04, 2026 11:15 UTC
Author

Summary

Implements #324 .
Depends on and includes #313 (the 20.0 migration). This PR adds one commit on top of it.

The module's models use the same names as the Enterprise hr_payroll models (hr.payslip, hr.salary.rule, hr.payroll.structure, ...). When both modules are installed, Odoo merges them into a single model/table, producing conflicting field definitions, silently overridden methods and mixed state machines — an installation that "works" at install time but is broken in practice.

Renaming the models to a dedicated payroll. namespace makes the two payroll engines fully independent and able to coexist on the same database (e.g. different companies using different engines).

Renamed models

| Old name | New name |
|---|---|
| hr.payslip | payroll.payslip |
| hr.payslip.line | payroll.payslip.line |
| hr.payslip.input | payroll.payslip.input |
| hr.payslip.run | payroll.payslip.run |
| hr.payslip.worked_days | payroll.payslip.worked_days |
| hr.salary.rule | payroll.salary.rule |
| hr.salary.rule.category | payroll.salary.rule.category |
| hr.payroll.structure | payroll.structure |
| hr.contribution.register | payroll.contribution.register |
| hr.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 abstract models (report.payroll.) are already namespaced and unchanged.

Fields on community models

hr_payroll extends the same community models, so the fields this module adds are namespaced as well:

| Model | Old field | New field |
|---|---|---|
| hr.version | struct_id | payroll_struct_id |
| hr.version | schedule_pay | payroll_schedule_pay |
| hr.employee | slip_ids | payroll_slip_ids |
| hr.employee | payslip_count | payroll_slip_count |

Other changes

  • Module files renamed to match the new model names (models/payroll_payslip.py, views/payroll_payslip_views.xml, ...)

  • Raw SQL table references updated (base_browsable, contribution register report)

  • migrations/20.0.1.0.0/pre-migration.py renames models, tables and fields for existing databases (openupgradelib)

  • Record xmlids, groups and sequences are unchanged
  • Notes

  • Record rules and ACLs now reference the payroll.* models — no group changes needed.

  • i18n files are left for ocabot regeneration.
  • Assisted-by: Devin:SWE-2 High

    Diff: 180317 lines (+180317 / -0) across 142 files Reviewer: BhaveshHeliconia Review duration: 27643m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.95) × (1 − Review Confidence (0.72)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.95 · 180317 lines diff across 142 files
    0.95
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.46 · 2 substantive comment(s)
    0.46
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    71%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Sensitive Paths sensitive_paths
    0.095
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    4 items
    oca-cla-bot[bot] oca-cla-bot[bot] commented on Nov 04, 2026 11:15 UTC
    Bot

    The following commit authors need to sign the Contributor License Agreement:

    h.apolinario.r@gmail.com
    milan.topuzov@salewise.io
    alexander@alexander.uz
    hilarak@gmail.com
    juanyadavilap@gmail.com
    muhammad.ali2@arbisoft.com

    ![CLA not signed](https://clabot.odoo-community.org/)<!-- CLA BOT SIGNING COMMENT DO NOT EDIT -->

    BhaveshHeliconia BhaveshHeliconia approved these changes on Nov 05, 2026 04:19 UTC
    Approved Reviewer

    LGTM!

    Thanks for implementing this!

    BhaveshHeliconia BhaveshHeliconia commented on Nov 05, 2026 04:25 UTC
    Contributor

    I also have a migration PR for the payroll_account module (#319), which depends on payroll.

    @dreispt, would you also like to handle the payroll_account refactoring to align it with these changes? If so, feel free to do so, and I'll close my PR. Otherwise, once this PR is merged, I'll update payroll_account accordingly.

    Assignees
    dreispt dreispt
    Labels
    risk: low confidence: 71.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 94.7% (HIGH) · Higher = larger blast radius
    94.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 71.7% · Lower = rushed or shallow review
    71.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.8% · Safe to merge
    26.8%
    Repository