Skip to content

[19.0][MIG] hr_expense_advance_clearing: Migration to 19.0#358

Draft
dnplkndll wants to merge 39 commits into
OCA:19.0from
ledoent:19.0-mig-hr_expense_advance_clearing
Draft

[19.0][MIG] hr_expense_advance_clearing: Migration to 19.0#358
dnplkndll wants to merge 39 commits into
OCA:19.0from
ledoent:19.0-mig-hr_expense_advance_clearing

Conversation

@dnplkndll
Copy link
Copy Markdown

@dnplkndll dnplkndll commented May 28, 2026

Port of hr_expense_advance_clearing from 18.0 to 19.0 (migration guide). Substantive redesign: 19.0 removed hr.expense.sheet, so the module moves from a sheet-based to a per-expense data model (design ADR).

Non-mechanical adaptations worth flagging

  • expense_type Selection (expense | advance) on hr.expense replaces the 18.0 sheet-level advance boolean.
  • clearing_advance_id (m2o) + clearing_expense_ids (o2m) replace the sheet's advance_sheet_idclearing_sheet_ids link — now per-expense.
  • hr.employee inherited directly (18.0's hr.employee.base abstract was dropped in 19.0); smart button mirrored onto hr.employee.public.
  • Sheet view inheritance dropped; views target hr.expense form/search (+ Advance / not-cleared / Clearing filters).
  • account.move._compute_amount resolves the clearing link via expense_id.clearing_advance_id instead of …sheet_id.advance_sheet_id.

Known limitation (deferred)

clearing_residual is computed by aggregating approved clearing expenses, not by journal reconciliation — the 18.0 sheet-level auto-reconciliation (routing the clearing credit to the advance account) is deferred to a follow-up. Standard reconciliation UI still works. Existing 18.0 advance/clearing data is migrated in place by migrations/19.0.1.0.0/ — the line-level advance/av_line_id fields survive core's sheet removal and map to expense_type/clearing_advance_id; sheet-only clearings without a line link are logged for manual review.

19.0 relevance

19.0 core has no advance/clearing concept (no advance/clearing in core hr_expense.py); distinct from core's action_pay.

@OCA-git-bot OCA-git-bot added series:19.0 mod:hr_expense_advance_clearing Module hr_expense_advance_clearing labels May 28, 2026
@dnplkndll dnplkndll force-pushed the 19.0-mig-hr_expense_advance_clearing branch 2 times, most recently from 247ba4c to 30c32a6 Compare May 29, 2026 20:22
kittiu and others added 25 commits May 29, 2026 16:37
[UPD] Update hr_expense_advance_clearing.pot

[UPD] README.rst

(cherry picked from commit 47c7398)
Fix install error when there are already some expense in system.

[UPD] README.rst

hr_expense_advance_clearing 12.0.1.0.1

(cherry picked from commit 1f3ec1e)
(cherry picked from commit df4f68f)
We should prevent setting the analytic account in expenses used as
employees advance. Otherwise, it can lead to errors charging against an
analytic account that later won't be compensated when all is reconcile.
Anyway, the advance is not an expense, but money of the company moving
from one place to another, that later will be used for real expenses
that will be imputed to the corresponding analytic account

(cherry picked from commit 2723fe7)
(cherry picked from commit c77a2bc)
(cherry picked from commit 26e9383)
mymage and others added 12 commits May 29, 2026 16:37
Currently translated at 100.0% (57 of 57 strings)

Translation: hr-expense-15.0/hr-expense-15.0-hr_expense_advance_clearing
Translate-URL: https://translation.odoo-community.org/projects/hr-expense-15-0/hr-expense-15-0-hr_expense_advance_clearing/it/
(cherry picked from commit 3a273f0)
Currently translated at 100.0% (56 of 56 strings)

Translation: hr-expense-16.0/hr-expense-16.0-hr_expense_advance_clearing
Translate-URL: https://translation.odoo-community.org/projects/hr-expense-16-0/hr-expense-16-0-hr_expense_advance_clearing/it/
(cherry picked from commit 1d62501)
…company so that the correct property can be retrieved

(cherry picked from commit 213cb2f)
…s might intervene.

TT55529

(cherry picked from commit 4a89241)
Currently translated at 100.0% (56 of 56 strings)

Translation: hr-expense-18.0/hr-expense-18.0-hr_expense_advance_clearing
Translate-URL: https://translation.odoo-community.org/projects/hr-expense-18-0/hr-expense-18-0-hr_expense_advance_clearing/it/
(cherry picked from commit 533941a)
…patibility)

Since some other modules can introduce other moves to the expense sheet,
this refactor allow some compatibility between those modules without
changing behavior on this module.

(cherry picked from commit 2be9623)
@dnplkndll dnplkndll force-pushed the 19.0-mig-hr_expense_advance_clearing branch from 30c32a6 to a59833d Compare May 29, 2026 20:37
@dnplkndll dnplkndll force-pushed the 19.0-mig-hr_expense_advance_clearing branch 2 times, most recently from 4e129b3 to 2868181 Compare May 30, 2026 18:16
hr.expense.sheet removed in 19.0; retarget to hr.expense (+ hr.employee.base->hr.employee).
@dnplkndll dnplkndll force-pushed the 19.0-mig-hr_expense_advance_clearing branch from 2868181 to 8d34ecc Compare May 30, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_expense_advance_clearing Module hr_expense_advance_clearing series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.