Skip to content

Conversation

@matthieusaison
Copy link

If you call transaction for an empty transaction days, payload returns no fields 'transaction_details' and raise an error.

@OCA-git-bot
Copy link
Contributor

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

@DeeEmm
Copy link

DeeEmm commented Oct 17, 2025

Ahh just stumbled across the same issue and came here to post a fix. Slightly different solution but essentially the same.

                data = self.with_context(
                    invalid_data_workaround=invalid_data_workaround,
                )._paypal_retrieve(url, token)
                
                
                transaction_details = data.get("transaction_details", []) 
                
                #    If the key is missing, it will use an empty list instead.
                transaction_details = data.get("transaction_details", [])
                
                interval_transactions = map(
                    lambda transaction: self._paypal_preparse_transaction(transaction),
                    transaction_details,
                )
               
                transactions += list(
                    filter(
                        lambda transaction: interval_start
                        <= self._paypal_get_transaction_date(transaction)
                        < interval_end,
                        interval_transactions,
                    )
                )

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