[16.0][OU-ADD] hr_expense: Migration to 16.0 - #4156
Conversation
|
/ocabot migration hr_expense Depends on :
|
marielejeune
left a comment
There was a problem hiding this comment.
Hi! Thanks for the migration script. Here is an error that I got.
82cb3b2 to
142374e
Compare
remi-filament
left a comment
There was a problem hiding this comment.
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
pedrobaeza
left a comment
There was a problem hiding this comment.
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