Skip to content
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

account.payment.method.line not connecting when migrating from 14 -> 15 #4257

Closed
Meisolsson opened this issue Dec 15, 2023 · 3 comments
Closed
Labels

Comments

@Meisolsson
Copy link

Module

payment

Describe the bug

Between version 14 and 15 the journal_id value became a computed field updated via account.payment.method.line objects. Currently this is not correctly migrated as the Payment Journal for the payment provider we installed it is empty after migration.

There is a migration for this in post-migration.py for the payment module but it doesn't do anything. Since the updated account.payment.method are created in the provider modules this migration runs before the required values are exists in the database. Current migration for reference post-migration.

I propose to move this migration step to a end-migration.py so that all values exists before it runs.

To Reproduce

Affected versions: 15

Steps to reproduce the behavior:

  1. Create a new database with payment and one of the included payment provider. (I've used payment_adyen)
  2. Run migration for v14 -> 15

Expected behavior
If we open the payment acquirer and look at the Payment Journal it should be set to the payment journal created by the payment provider we installed.

Additional context

@pedrobaeza
Copy link
Member

Hi, Henrik, are you sure that's the problem? The SQL should match all the existing payment providers, no matter if later the code is changed.

@Meisolsson
Copy link
Author

Well what we are matching here is not the provider. The connection is payment.acquirer -> account.payment.method -> account.payment.method.line -> account.journal. In version 14 the account.payment.method.line is not there and the account.payment.method is only created by the system.

In version 15 each provider creates a new account.payment.method via the XML. Then in the migration we find all account.payment.method that matches the payment.acquirer and that matches the account.journal. So without the account.payment.method the connection can never be done by the migration as this point.

So at the point that the migration runs it will not find the newly created account.payment.method.

@pedrobaeza
Copy link
Member

OK, please do a PR moving the method to end-migration. Add in the docstring of the method the explanation why it should be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants