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

[16.0][IMP] Allow to use the storage either from the payment mode or from the payment method #1417

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

AnizR
Copy link

@AnizR AnizR commented Feb 10, 2025

I reopened: #1279 that aims to push payment file to a distant storage by @lmarion-source.

With a small twist:

IMO, pushing to the storage should be done as late as possible because we may not have control over it.
Therefore, if an error occurs after sending the file we may not be able to remove the file from the storage.

I had a case where my client had an error when changing the state of a payment order to 'generated'. He tried multiple times and sent duplicate of a payment file because the error was thrown after the file's sending.

@AnizR AnizR force-pushed the 16.0-improve_account_payment_method_fs_storage branch 3 times, most recently from 473d250 to 516c03d Compare February 14, 2025 09:58
@@ -103,6 +103,8 @@ def test_payment_method_fs_storage(self):
order.draft2open()
with self.with_custom_method():
action = order.open2generated()
# commit need to be performed in order to perform the 'postcommit'
self.env.cr.commit() # pylint: disable=E8102
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not doing your own sub-savepoint?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, adding a savepoint wasn't possible since I was commiting (savepoints are destroyed once the transaction is commited).
But, I could avoid to commit and manualy run the 'postcommit' of the cursor.
Thanks for the suggestion!

@AnizR AnizR force-pushed the 16.0-improve_account_payment_method_fs_storage branch 2 times, most recently from a640068 to ccff7ac Compare February 17, 2025 10:52
@AnizR AnizR force-pushed the 16.0-improve_account_payment_method_fs_storage branch from ccff7ac to 7732a10 Compare February 17, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants