Skip to content

[FIX] account_statement_import_online_paypal: Fix error importing Pay…#858

Open
sefirosweb wants to merge 2 commits into
OCA:16.0from
sefirosweb:16.0
Open

[FIX] account_statement_import_online_paypal: Fix error importing Pay…#858
sefirosweb wants to merge 2 commits into
OCA:16.0from
sefirosweb:16.0

Conversation

@sefirosweb
Copy link
Copy Markdown

[FIX] account_statement_import_online_paypal: Fix error importing PayPal transactions with null fee_amount (#857)

This commit solves issue #857 (#857), which caused an error when importing PayPal transactions with a null fee_amount.

Additionally, it fixes the way raw_data is stored in the database to ensure it can be correctly retrieved and processed later.

…Pal transactions with null fee_amount (OCA#857)

This commit solves issue OCA#857 (OCA#857), which caused an error when importing PayPal transactions with a null fee_amount.

Additionally, it fixes the way raw_data is stored in the database to ensure it can be correctly retrieved and processed later.

Co-authored-by: Sefirosweb
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @alexey-pelykh,
some modules you are maintaining are being modified, check this out!

@sefirosweb
Copy link
Copy Markdown
Author

This PR removes the function _paypal_preparse_transaction because it has
become obsolete. The method is no longer used anywhere in the PayPal provider’s
functional workflow, and its original purpose has been replaced by newer logic
inside _paypal_get_transaction_date.

The only remaining reference to this method is in a very specific unit test,
which calls _paypal_preparse_transaction directly. Since the function no
longer plays any role in the module’s behavior, this test now fails simply
because it is asserting behavior that no longer exists in the codebase.

In other words: the failure does not come from a regression, but from a test
that targets functionality that is no longer part of the module.

I am opening this PR so the maintainers can review whether this test still has
any reason to exist, or if it should be updated/removed to align with the
current implementation of the PayPal provider.

Please confirm whether the test should be kept, adapted, or removed given the
current state of the module.

best,

Copy link
Copy Markdown
Contributor

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

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

Good refactoring — consolidating the date parsing into _paypal_get_transaction_date and dropping _paypal_preparse_transaction makes the flow cleaner. One thing to note: raw_data changes from a dict to json.dumps(transaction) (string), which is a behavior change for anything reading raw_data downstream. Tests are currently failing — once CI is green this will be easier to evaluate fully.

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