-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
[16.0][OU-ADD] hr_expense: Migration to 16.0 #4156
Conversation
/ocabot migration hr_expense Depends on :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for the migration script. Here is an error that I got.
openupgrade_scripts/scripts/hr_expense/16.0.2.0/pre-migration.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments
openupgrade_scripts/scripts/hr_expense/16.0.2.0/post-migration.py
Outdated
Show resolved
Hide resolved
openupgrade_scripts/scripts/hr_expense/16.0.2.0/post-migration.py
Outdated
Show resolved
Hide resolved
openupgrade_scripts/scripts/hr_expense/16.0.2.0/post-migration.py
Outdated
Show resolved
Hide resolved
82cb3b2
to
142374e
Compare
openupgrade_scripts/scripts/hr_expense/16.0.2.0/post-migration.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @victoralmau , thank you for this PR.
I have tested your module when migrating our instance, and I face an issue when trying to reconcile payment on account move (state and payment_state are not updated to paid on hr.expense.sheet).
After some digging, I realized that from v16.0 onwards, account_move related to hr_expense_sheet are created with move_type = "in_invoice" (when there was no move_type before so it ended up with default "entry") as per https://github.com/odoo/odoo/blob/87f4667d81f7d8a40dcf225f3daf1a9e2795680d/addons/hr_expense/models/hr_expense.py#L1297
Then in _compute_payment_state from account_move it will check if account.move is of type invoice (with is_invoice function here : https://github.com/odoo/odoo/blob/87f4667d81f7d8a40dcf225f3daf1a9e2795680d/addons/account/models/account_move.py#L926 and if move_type is "entry" it would ends up with payment_state = "not_paid".
Therefore, I think that this migration script needs to update move_type for all moves with an expense_sheet_id to "in_invoice"
901e37c
to
1c90b94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the comments attended including @remi-filament's one, plus the final fixes + improvements I have done reviewing the PR
1c90b94
to
55df4ef
Compare
55df4ef
to
07f62e8
Compare
Migration to 16.0
Depends on:
@Tecnativa TT43223