[19.0][ADD] payroll_work_entry: compute worked days from work entries #284
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.66) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 374 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.355
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #284"
general
weight: 0.35
nimarosa
New module: build a payslip's worked days from
hr.work.entry.Why
payrollderives worked days from the resource calendar — what the employee should have worked (hr_payslip.py,_compute_worked_days, withcompute_leaves=False). Where an installation records work entries, that data describes what actually was worked: attendances, overtime, absences.For a workforce that clocks in, the difference is not cosmetic. The payslip silently ignores the attendance records the system already has: overtime is never paid and absences are never deducted, because the calendar says every day was a full one.
hr_work_entryis Community in 19.0, andhr.work.entryis already adapted tohr.version, so the bridge is small.What it does
worked_days.OVERTIMEhours_per_day, so a 12-hour shift counts as one day rather than one and a halfContracts with no work entry in the period fall back to
payroll's calendar computation, so installing this module changes nothing for them.On states
Only
validatedentries count. Draft, cancelled and conflicting ones are deliberately excluded: a conflict is Odoo telling you the record is not trustworthy, and paying it would hide the problem instead of surfacing it.Worth knowing when adopting this: Odoo validates one work entry per employee and day. A second entry on a date that already has a validated one stays in conflict, so overtime recorded on the same day as an attendance needs a work entry model that accounts for it or it will never reach the payslip. That is upstream behaviour, not something this module introduces, but it is the first thing people hit.
Testing
0 failed, 0 errors of 7 testsonodoo:19.0Community, on a database without demo data.Coverage: hours taken from the entries rather than the calendar, one line per type, a rule reading the recorded hours, draft/cancelled entries excluded, entries outside the period ignored, days following
hours_per_day, and the fallback to the calendar when there are no entries.Fixtures are built in
setUpClass. Two details that cost me time and are baked into them: a bareresource.calendarwith no attendance lines makes every entry fall outside calendar and unvalidatable — the tests copy the company calendar; and writingstate = 'validated'directly leaves the record in conflict, so they go throughaction_validate().---
Assisted-by: Claude Opus 4.8
Disclosed per the OCA Generative AI / LLM Policy.
Developed and verified under my direction and review; I take responsibility for the contribution.