[19.0][MIG] hr_expense_cancel: Migration to 19.0#356
Draft
dnplkndll wants to merge 32 commits into
Draft
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.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. 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/
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
10bc2ca to
a91b5f6
Compare
Odoo 19.0 removed hr.expense.sheet. Core's hr.expense.action_reset() (addons/hr_expense/models/hr_expense.py:1210) already reverses + cancels posted moves and unlinks draft moves. This module augments that flow with the payment-side teardown that core leaves intact: - Override hr.expense.action_reset() to draft-cancel linked payments (via hr_expense_payment.payment_ids) and unreconcile their lines before calling super(). - _remove_reconcile_hr_invoice + _remove_move_reconcile helpers move from sheet to expense, work per-expense rather than per-sheet. - Drop views/hr_expense_views.xml — core already exposes the Reset button on the expense form; we just augment the behaviour. - Tests rewritten against the 19.0 per-expense flow (action_submit / action_approve / post_expenses_with_wizard / action_pay). account_payment.action_draft_cancel() helper unchanged — action_draft() and action_cancel() still exist on account.payment in 19.0.
1b60db9 to
5472351
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_cancel` from 18.0 to 19.0 (migration guide).
Depends on OCA/hr-expense#355 (hr_expense_payment) — pinned via `test-requirements.txt`.
Non-mechanical adaptations worth flagging
19.0 relevance
The 18.0 module's value (let the user undo a posted expense + its payment + reconciliation chain) is partly absorbed by core's `action_reset` but the payment + cross-module reconcile cleanup is left to the addon ecosystem. `hr_expense_invoice` (Wave D, not yet ported) also needs the cross-module unreconcile path to keep working when reset happens after a bill has been generated.
Tests
The `Detect unreleased dependencies` CI red is expected — `[DO NOT MERGE]` dep-pin to #355. Strip the pin once #355 lands.