[19.0][MIG] hr_expense_cancel: Migration to 19.0 - #356
Open
dnplkndll wants to merge 25 commits into
Open
Conversation
This module lets to cancel and correct expenses. It adds a cancel button on the expense sheet that undo reconciliations and delete payments and journal entries.
The multi own account test has been removed as it is no longer possible in odoo core to register the payment of several expense sheet reports at the same time. Co-Authored By: Stefan Ungureanu aiendry-aktivsoftware
In this version, if a product doesn't have cost, you are only able to enter total amount, so the test should be adjusted to this condition.
dnplkndll
force-pushed
the
19.0-mig-hr_expense_cancel
branch
4 times, most recently
from
May 29, 2026 20:09
1b60db9 to
5472351
Compare
dnplkndll
force-pushed
the
19.0-mig-hr_expense_cancel
branch
4 times, most recently
from
June 19, 2026 19:12
d6ad906 to
62ef7a7
Compare
Currently translated at 100.0% (4 of 4 strings) Translation: hr-expense-17.0/hr-expense-17.0-hr_expense_cancel Translate-URL: https://translation.odoo-community.org/projects/hr-expense-17-0/hr-expense-17-0-hr_expense_cancel/it/
in V18 you can only create moves for submitted sheets odoo/odoo@f892800#diff-42c75e4d29952aadf0abdd1bfe7e066bef3db1275c16d64dd3f3b96a332a2ff3
dnplkndll
force-pushed
the
19.0-mig-hr_expense_cancel
branch
from
June 22, 2026 18:28
62ef7a7 to
fa7af75
Compare
pilarvargas-tecnativa
suggested changes
Jul 23, 2026
pilarvargas-tecnativa
left a comment
There was a problem hiding this comment.
This migration still depends on hr_expense_payment and uses its custom hr.expense.payment_ids relation.
dnplkndll
force-pushed
the
19.0-mig-hr_expense_cancel
branch
from
July 23, 2026 23:13
fa7af75 to
9272396
Compare
dnplkndll
marked this pull request as ready for review
July 27, 2026 19:27
Author
|
@pilarvargas-tecnativa updated to remove the hr_expense_payment dap and I think hr_expense_payment can be dropped |
hr.expense.sheet was removed in 19.0; the reset flow moves to a per-expense hr.expense.action_reset() override. - action_reset() tears down linked payments (unreconcile + draft-cancel) and the posted move before super(), so core's reset guard passes. Everything runs with the caller's rights, as in 18.0: payment teardown keeps requiring accounting ACL, and expenses without a move (the everyday employee reset) touch no accounting model. - The hr_expense_payment dependency is dropped: payments are found via core's reconciled_payment_ids (reconciliation walk union stored matched_payment_ids), and the unreconcile walks partials via _get_reconciled_amls() instead of full_reconcile_id. Assisted-by: Claude Opus 5
dnplkndll
force-pushed
the
19.0-mig-hr_expense_cancel
branch
from
July 27, 2026 20:11
9272396 to
45a6ab4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of
hr_expense_cancelfrom 18.0 to 19.0 (migration guide).Non-mechanical adaptations worth flagging
hr.expense.sheet.action_canceltohr.expense.action_reset()— core'saction_resetrefuses to reset an expense linked to a posted entry; the module tears down payments and the posted move first so the guard passes. Everything runs with the caller's rights, as in 18.0: payment teardown requires accounting ACL, and expenses without a move (the everyday employee reset) touch no accounting model.hr_expense_payment: payments are found via core'sreconciled_payment_ids(reconciliation walk ∪ storedmatched_payment_ids, so wizard payments whose reconciliation was removed are torn down too), and_remove_move_reconcilewalks partials via_get_reconciled_amls()instead offull_reconcile_id.expense.account_move_id.payment.staterename: 18.0'cancel'→ 19.0'canceled'.19.0 relevance
Core's
action_resetreverses the expense's move but refuses when payments exist; payment-side teardown is this module's remaining value.AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.