Skip to content

[19.0][FIX] payroll_account: preserve existing entries on reset, recalculation and confirmation - #1

Open
votrelec wants to merge 2 commits into
Jenrax-git:19.0-mig-payroll_accountfrom
votrelec:fix/19-posted-payroll-lifecycle
Open

votrelec wants to merge 2 commits into
Jenrax-git:19.0-mig-payroll_accountfrom
votrelec:fix/19-posted-payroll-lifecycle

Conversation

@votrelec

@votrelec votrelec commented Nov 9, 2026 •

Copy link
Copy Markdown

With an existing accounting entry, direct salary-line, worked-time and input edits can diverge from the journal entry. Recalculation/reset also retain an outdated entry, while confirmation with without_compute_sheet=True can create another entry and replace the original link.

Lock and check the parent before financial child creation/edit/deletion/reassignment, payroll identity/state/link changes, recalculation, reset and confirmation. A shared abstract guard covers the three child models, including context defaults and mixed batches. Parent access is checked before SQL locks. Descriptions remain editable. Checking confirmation separately covers flags that skip calculation. Draft edits, native cancellation and refund_sheet() remain available; hash-restricted cancellation performs its internal detach after the explicit reversal.

This targets the migration branch behind OCA/payroll#269, rather than resubmitting the complete migration to OCA's base branch.

Validation on Odoo 19, isolated fresh databases with only core dependencies and the OCA payroll/accounting modules:

  • All 30 accounting-bridge tests pass, including cancellation, hash-restricted journals, native refund_sheet, child edits/reassignment/defaults, mixed batches and an ordinary payroll officer responsible for the employee's department.
  • The same three regression cases on ef16a76b00462717d982b6a4f45082723255b1bf reproduce exactly 3 failures and no errors.
  • Before the child extension, the expanded 28-test suite reproduces exactly 5 failures/0 errors on the previously proposed lifecycle fix. These are separate baseline runs, not eight failures from a single run.
  • The accounting test helper now supplies its configured required journal explicitly; it previously relied on an absent general-journal default in a clean database. Journal-selection tests remain separate.
  • Native POT extraction and the Slovak Python message are included. Readme source fragments are updated; the README generator was unavailable locally.

@votrelec
votrelec marked this pull request as ready for review November 9, 2026 13:16
@votrelec
votrelec force-pushed the fix/19-posted-payroll-lifecycle branch from 613cb5c to 824c725 Compare November 9, 2026 15:56
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.

1 participant