-
-
Notifications
You must be signed in to change notification settings - Fork 725
[15.0][OU-FIX] fix hr.expense account.move and lines #4577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 15.0
Are you sure you want to change the base?
[15.0][OU-FIX] fix hr.expense account.move and lines #4577
Conversation
openupgrade_scripts/scripts/hr_expense/15.0.2.0/post-migration.py
Outdated
Show resolved
Hide resolved
fix the value of several fields on account.move and account.move.line records linked to hr.expense records. Co-authored-by: Miquel Raïch <[email protected]>
fiscalyear_lock_date check prevent modifying old move, but some field should be recomputed to be correct in 15.0.
06a9b31
to
ab1834d
Compare
I need why this is needed with an example dataset that fails previously. In general, I don't want to call the general method |
@pedrobaeza could you tell me in which form this dataset should be presented? about |
I mean the records with their field values you have previous the migration and the result after for requiring this recomputation. |
fix the value of several fields on
account.move
andaccount.move.line
records linked tohr.expense
records.this computes
account.move.line.exclude_from_invoice_tab
differently than #4386 did. the goal remains the same: it should be true for destination lines. the code was assuming that destination lines where the ones with a quantity of 0, but this does not work, as odoo 14 does not set a quantity on those lines and the default value for this field is 1. instead, this field is computed by checking that the account is of type"payable"
.with
exclude_from_invoice_tab
correctly set, it is now safe to callaccount.move._compute_amount()
to correctly recompute several fields (always_tax_exigible
,amount_residual
,amount_residual_signed
,amount_untaxed
,amount_untaxed_signed
,payment_state
) of theaccount.move
without changing accounting data.account.move.write()
checks that reconciled moves are not changed, and with this code, it succeeds.this code also recomputes these fields for
account.move
records not directly linked tohr.expense.sheet
records, but linked to anhr.expense
record through theiraccount.move.line
records, since this is howaccount.move._payment_state_matters()
selects the records.