[19.0][OU-FIX] hr_expense: Compute expense state by SQL - #5909
Open
pedrobaeza wants to merge 1 commit into
Open
Conversation
pedrobaeza
force-pushed
the
19.0-ou_fix-hr_expense
branch
3 times, most recently
from
August 13, 2026 22:13
0fa5e50 to
22fffa3
Compare
Member
Author
|
@hbrunn I have moved the script to end-migration, but the test is performed in post. Is there a way to perform the test at the end instead? |
Doing it by ORM is not advised due to performance, but also because some business constraints can be triggered, like in this case `_check_can_approve`, provoking a crash in the migration. There's also a problem in executing it in post-migration instead of end-migration: if the extra modules changing `_get_invoice_in_payment_state` are not yet loaded, you won't get `in_payment` state, so the logic has been converted to SQL, and move to end-migration. TT61992
pedrobaeza
force-pushed
the
19.0-ou_fix-hr_expense
branch
from
August 14, 2026 10:37
22fffa3 to
3cd9133
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.
Doing it by ORM is not advised due to performance, but also because some business constraints can be triggered, like in this case
_check_can_approve, provoking a crash in the migration.There's also a problem in executing it in post-migration instead of end-migration: if the extra modules changing
_get_invoice_in_payment_stateare not yet loaded, you won't getin_paymentstate, so the logic has been converted to SQL, and move to end-migration.@Tecnativa TT61992