[17.0][OU-FIX] payment: assign payment_method_ids on duplicated providers #5283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up of #4692 (comment)
When payment providers are duplicated (for being used on another company most of the time), the previous script implementation did not set method_ids on these ones (since it did it only on payment providers with an External ID so created at module installation).
This PR fixes that behaviour by setting payment_method_ids on payment providers based on (in the following order) :
Also, I realize that payment_method_ids were not updated for 4 modules (payment_asiapay, payment_ogone, payment_payulatam and payment_payumoney) (since these are not even present in openupgrade_scripts / scripts directory) so I handled those also here.
I also changed readme to set as done all the payment modules which had no other changes.
Eventually, I also took the opportunity to update payment_custom and payment_demo migration scripts (I could not handled these ones in payment directly since only when installed they install their own payment_method).