-
-
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
[17.0][OU-ADD] payment: Migration scripts #4584
base: 17.0
Are you sure you want to change the base?
Conversation
for reference, the 5 key commits for v17: https://github.com/akretion/odoo-module-diff-analysis/tree/main/17.0/payment |
d7cf356
to
0944bd0
Compare
Remove payment.payment_method_acss_debit as does not exist anymore Move payment.icon to payment.method Reload payment methods and links to providers
0944bd0
to
39973e6
Compare
Thanks @rvalyi it helps understanding where the changes come from (although in that case many changes were on data so there are more commits to take into account). |
/ocabot migration payment |
This comment was marked as outdated.
This comment was marked as outdated.
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.
Totally agree with renaming payment.icon
to payment.method
, as that will be the base for whatever migrations of modules depending on payment
do.
Not so sure yet about the full reload of the payment methods, shouldn't we only force load new fields like primary_payment_method_id
? Or the other way around, not touch active
and sequence
?
for payment_token in PaymentToken.search([("payment_method_id", "=", False)]): | ||
payment_token.payment_method_id = ( | ||
PaymentMethod._get_from_code(payment_token.provider_id.code) | ||
or unknown_payment_method | ||
).id | ||
|
||
for transaction in PaymentTransaction.search([("payment_method_id", "=", False)]): | ||
transaction.payment_method_id = ( | ||
PaymentMethod._get_from_code(transaction.provider_id.code) | ||
or unknown_payment_method | ||
).id |
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.
can we group those by provider_id and do only one write per provider?
"payment_provider", | ||
"payment_icon_ids", | ||
"payment_method_ids", | ||
), |
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.
for this to work we'll also have to rename payment_icon_payment_provider_rel
I think, and in there payment_icon_id
to payment_method_id
(I wonder if we should actually add this to rename_fields, seems a common enough task)
Take over payment migration from PR #4466 upon @duong77476-viindoo request (#4466 (comment))
Extra tasks performed :