[19.0][MIG] hr_expense_payment: Migration to 19.0#355
Draft
dnplkndll wants to merge 33 commits into
Draft
Conversation
(cherry picked from commit 958f048)
(cherry picked from commit 1fb90c1)
(cherry picked from commit 3117aaf)
(cherry picked from commit 8af8d1d)
(cherry picked from commit 58e36ee)
(cherry picked from commit 288a719)
(cherry picked from commit e209ca1)
(cherry picked from commit cb26762)
(cherry picked from commit caf1f0b)
(cherry picked from commit 956f61c)
(cherry picked from commit dac1f33)
(cherry picked from commit e242daf)
Currently translated at 100.0% (6 of 6 strings) Translation: hr-expense-16.0/hr-expense-16.0-hr_expense_payment Translate-URL: https://translation.odoo-community.org/projects/hr-expense-16-0/hr-expense-16-0-hr_expense_payment/it/ (cherry picked from commit 4aee4df)
(cherry picked from commit 7069276)
(cherry picked from commit c797712)
(cherry picked from commit cd2e59b)
(cherry picked from commit 0cf4e03)
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-expense-16.0/hr-expense-16.0-hr_expense_payment Translate-URL: https://translation.odoo-community.org/projects/hr-expense-16-0/hr-expense-16-0-hr_expense_payment/ (cherry picked from commit 57cb790)
(cherry picked from commit c71a6fa)
(cherry picked from commit 69560c7)
(cherry picked from commit 02e018f)
(cherry picked from commit c9932e4)
Related to odoo/odoo@2dc6b6c (cherry picked from commit 8692a69)
(cherry picked from commit 72ceb08)
(cherry picked from commit 6660847)
…thod (cherry picked from commit a82dace)
(cherry picked from commit df0b0b0)
(cherry picked from commit 6a3bf00)
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: hr-expense-18.0/hr-expense-18.0-hr_expense_payment Translate-URL: https://translation.odoo-community.org/projects/hr-expense-18-0/hr-expense-18-0-hr_expense_payment/ (cherry picked from commit fecb164)
Currently translated at 100.0% (5 of 5 strings) Translation: hr-expense-18.0/hr-expense-18.0-hr_expense_payment Translate-URL: https://translation.odoo-community.org/projects/hr-expense-18-0/hr-expense-18-0-hr_expense_payment/it/ (cherry picked from commit 0b64eb0)
bc36318 to
e3d066b
Compare
e3d066b to
78afa4d
Compare
hr.expense.sheet was removed in 19.0; retarget the payment register to hr.expense.
78afa4d to
5f7aadb
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_paymentfrom 18.0 to 19.0 (migration guide).Non-mechanical adaptations worth flagging
hr.expense.sheetis removed in 19.0 — the M2M moves tohr.expensedirectly. New relation table:payment_hr_expense_rel; new field names:hr.expense.payment_ids↔account.payment.expense_ids. No schema migration shipped (this is a brand-new module install on 19.0).hr.expense.sheet.action_register_payment. 19.0 overrideshr.expense.action_pay()(the core method that launches the register-payment wizard from an expense). Both thread the source-record ids throughcontextso the wizard's_create_payment_vals_from_*can populate the back-link._create_payment_vals_from_batchauto-derives expenses fromaccount.move.expense_idswhen no caller context is set. 19.0 core addedexpense_idsas a One2many onaccount.move(/addons/hr_expense/models/account_move.py:12), so payments registered directly from the move side still populate the back-link without manual context threading.post_init_hooknow walks per-expense reconciliation viaexpense.account_move_id(the receipt). 18.0 walked per-sheet viasheet.account_move_ids(M2M).19.0 relevance — community comment requested
19.0 core already provides
hr.expense.action_pay()and full company-paid automation (_create_company_paid_movesat/addons/hr_expense/models/hr_expense.py:1566→_prepare_payments_valsat :1619). This module is not about adding payment UI — that's in core.This module adds:
hr.expenseto theaccount.paymentrecords that paid it (the reverse direction core doesn't track explicitly beyond reconciliation).Open question for the community: should the back-link be promoted into core? The reconciliation-walking
post_init_hookis non-trivial precisely because core lacks the direct field. If maintainers prefer a leaner module footprint, thehr.expense.payment_idsM2M could be a candidate for an Odoo core PR.Happy to drop the
expense_idsreverse onaccount.move-side wizard auto-derivation if reviewers prefer the explicit-context-only path (simpler, but loses the back-link when payments are registered from the move's own button).