Skip to content

[IMP] l10n_sk_hr_payroll_oca: expose annual January tax fact reader - #51

Closed
votrelec wants to merge 3 commits into
Data-Dance:19.0from
votrelec:agent/annual-january-version-provider-20261117
Closed

votrelec wants to merge 3 commits into
Data-Dance:19.0from
votrelec:agent/annual-january-version-provider-20261117

Conversation

@votrelec

@votrelec votrelec commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Expose one cooperative singleton reader on the OCA annual reconciliation for the January tax fact. The annual pension default and action_compute both use it; the default delegates to the existing dated employee reader and retains the draft fallback and annual company/pension-consistency checks. Monthly payroll and employment dates stay unchanged.

Extensions can supply a separately reviewed native January version for annual income after employment ended. Evidence responsibilities, read-only repeated calls and OCA engine scope are documented in doc/DEVELOPER.md. User-facing EN/SK pages contain no developer extension section. The 18.0 carry-over task is in the active Unreleased list.

Validation: the prior complete343-test run passed with sk_SK loaded and stock OCA payroll. This QA/documentation-only review followup passed normal startup and all six targeted reader tests, exit0 without logger errors. The company and pension tests now require the specific English-context guard and an actual reader invocation. In a separate controlled source copy, reverting both call sites to the employee reader makes the pension test fail (1 failure,0 errors), proving it no longer passes on an unrelated ended-employment error. Production model files are unchanged by this followup.

Version19.0.1.26.2 follows the accepted monthly-wage hook release. Please regenerate the rendered pages with your generator at port.

Share the cooperative annual reader between pension defaults and annual calculation, preserving the default employment selection and existing checks. Exercise real annual results for separately reviewed facts after employment ends.

Assisted-by: OpenAI Codex
The cross-company reader test already owns an employee/year reconciliation. Reuse it so the test reaches the actual company check instead of the valid unique-year constraint. Financial runtime is byte-identical.

Assisted-by: OpenAI Codex
@Rad0van

Rad0van commented Nov 17, 2026

Copy link
Copy Markdown
Member

Thank you, this is a tidy and well-scoped extension point. The two call sites read the January tax fact through one reader, the default delegates to the existing employee reader, and the annual company and pension-consistency checks stay in action_compute after the hook, so an extension cannot skip them. We would like to take it with a few small adjustments, most of which we can make ourselves when porting.

What we checked

Default behaviour is unchanged for stored records: company_id on the reconciliation is required, so the self.company_id or self.employee_id.company_id the reader now uses in action_compute only differs from the previous rec.company_id for an unsaved record, where the pension default already used the same expression. The active employee, the ended-employment refusal, the draft _get_version fallback for the pension default and both consistency checks behave as before.

The hook is a private method and adds no field, so nothing in it is settable or callable over RPC.

The series applies cleanly with git am -3 on the current 19.0. Our scoped run (/l10n_sk_hr_payroll_oca, /l10n_sk_hr_payroll_base, /l10n_sk_hr_payroll_surcharges_oca, sk_SK loaded, no demo, fresh install) went from 0 failed, 0 errors of 247 tests on 19.0 to 0 failed, 0 errors of 253 with the PR, exit 0. With the two call sites reverted to the direct employee reader and your tests kept, the company-check test fails and both reviewed-fact tests error, so the tests do exercise the hook.

Requests

  1. test_annual_fact_extension_retains_pension_consistency_check passes even without the hook: the default reader refuses the ended employment with its own UserError, which satisfies assertRaises(UserError). We confirmed it: with the call sites reverted, that test still passed. Please assert the specific error, for example with assertRaisesRegex on the "Reconcile the 1 January tax pension flag" message under an en_US context (the suite runs with sk_SK loaded, so a bare English regex matches nothing). The same tightening would help test_annual_fact_extension_cannot_skip_company_check, although that message is shared with the reader's own company check.

  2. The developer section belongs in doc/DEVELOPER.md rather than in doc/en.md and doc/sk.md. The generator never renders DEVELOPER.md, while en.md becomes the module's Apps description and its README.rst, so as written a method name and override guidance land in front of payroll users. One English copy in DEVELOPER.md is enough; [IMP] payroll: expose a cooperative monthly cash wage input #49 already uses that file.

  3. Changelog: the carry-over bullet should go into the existing Carry-over to 18.0 list under Unreleased, which is where we track 18.0 debt and mark it discharged, not into the release's Added list.

What we will do on our side

Regenerate the rendered pages and README.rst (with them regenerated, the docs check passes with 0 errors and 0 warnings in strict mode), and keep 19.0.1.26.2, which now follows #49 (merged as 19.0.1.26.1). The two touch the same manifest line and changelog tail, so we will resolve that trivial overlap at port; no rebase needed on your side.

The Enterprise engine's annual reconciliation does not need a mirror for this PR. Our parity gate checks module pairing and engine exclusivity, not method shapes, and passes unchanged, and your note correctly scopes the hook to the OCA annual model. If an Enterprise extension ever needs the same entry point, note that the Enterprise action_compute has no explicit company check after reading the version, because it relies on the reader's own check; a mirrored hook there would need that check added as well, which we would do ourselves.

Verdict: approve once items 1 to 3 are addressed. We are also happy to make them on our side when we port, if that suits you better.

Assert exact annual guards and reader calls; keep extension guidance in developer documentation and carry-over work in the active list.

Assisted-by: OpenAI Codex
@votrelec

Copy link
Copy Markdown
Contributor Author

Addressed review items1-3 in cb7deab:

  1. Both checks assert their specific UserError under en_US and assert the annual reader was called. The pension test also has a controlled mutation check: bypassing the two call sites yields exactly1 failure,0 errors, instead of passing on the ended-employment error.
  2. Moved the extension guidance out of both user pages into one English section in doc/DEVELOPER.md.
  3. Moved the 18.0 task into the existing Carry-over to18.0 list under Unreleased.

Normal startup and the six targeted reader tests pass with sk_SK loaded (0 failures,0 errors,exit0). The existing full343 result is retained; no production model changed in this followup. Rendered-page regeneration remains on your side as offered. Thank you for the precise review.

@Rad0van

Rad0van commented Nov 17, 2026

Copy link
Copy Markdown
Member

Thank you, all three items verified. Merged into our 19.0 as d6b6d576. The three commits are squashed into one under your name (60169417), because the manifest line and changelog tail overlapped #49: the model, tests and DEVELOPER.md are byte-identical to your head, and the 19.0.1.26.2 entry and carry-over line were written onto the current changelog. On top of it (f04f0282): pages regenerated. 290/290 with sk_SK loaded (OCA, surcharges, MVP, VPP, parity). The change reaches this repository with the next sync. Closing here.

@Rad0van Rad0van closed this Nov 17, 2026
Rad0van pushed a commit that referenced this pull request Nov 17, 2026
3 source commit(s) since b12cbba7, 2 of which changed a module here.

* [IMP] l10n_sk_hr_payroll_oca: expose annual January tax fact reader
  60169417 — l10n_sk_hr_payroll_oca

  One cooperative singleton reader on the annual reconciliation for the
  January tax fact, used by the annual pension default and action_compute.
  The default delegates to the dated employee reader and keeps the draft
  fallback; an extension can supply a reviewed version for annual income
  after an employment ended. The company and pension-consistency checks
  still run after it.

* [IMP] l10n_sk_hr_payroll_oca: pages as in cssk-public #51
  f04f0282 — l10n_sk_hr_payroll_oca

207 modules in this repository.

Co-authored-by: votrelec <votrelec@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants