-
-
Notifications
You must be signed in to change notification settings - Fork 785
[17.0][OU-ADD] payment: Migration to 17.0 #4692
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
Conversation
|
/ocabot migration payment |
openupgrade_scripts/scripts/payment/17.0.2.0/noupdate_changes.xml
Outdated
Show resolved
Hide resolved
openupgrade_scripts/scripts/payment/17.0.2.0/noupdate_changes_work.xml
Outdated
Show resolved
Hide resolved
|
Could you rebase? |
Remove payment.payment_method_acss_debit as does not exist anymore Move payment.icon to payment.method Reload payment methods and links to providers
|
done |
|
/ocabot merge nobump |
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
Congratulations, your PR was merged at 526961d. Thanks a lot for contributing to OCA. ❤️ |
|
Hi @hbrunn @MiquelRForgeFlow @pedrobaeza In this scenario, payment_provider stripe has been duplicated for the second company, and therefore does not hold XML-id. Therefore the new payment methods (and in particular "card" one were not applied on this provider) and when running end-migration script I get the following UserError from payment_method write() method (https://github.com/odoo/odoo/blob/a73211ad089c238d193d928a70d2586cb92e4707/addons/payment/models/payment_method.py#L184) : I am not sure how to proceed from there, and would appreciate your insights ! |
|
Shouldn't you adjust your DB to have the primary provider enabled in the second company? |
|
You mean using the payment_provider stripe with XML id on my secondary company ? |
|
Then I read bad the code... The other part of the condition is about payment methods. Maybe you need to set them properly? |
|
Exactly and this is my point, payment methods changed a lot between 16.0 and 17.0 and were reloaded on payment_provider with this file : OpenUpgrade/openupgrade_scripts/scripts/payment/17.0.2.0/noupdate_changes_work.xml Line 395 in cb3a56f
The problem is that during migration we are only updating those payment methods on records with XML id (which were noupdate here), but we are not on the paymment provider created manually from those (which should have the same code as original ones but no XML id). I need to figure out the best way to reload these updated methods on the payment providers without XML id... |
|
I could solve the issue by only looking at existing payment methods on payment provider and adding the primary_method from those if missing. |
|
OK, let's do that assignment for all the copies of each payment provider. Can you do the PR? |
|
Yes I will, I would need confirmation on a couple of things to ease the process :
Thanks ! |
|
Isn't there the provider code? And I would use the noupdate changes file as the template, and even write the same data for all of them at once and don't load that noupdate data. |
continuation of #4584