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

[14.0][FIX/IMP] account_payment_order: use payment_reference if present for out payments #1371

Conversation

FrankC013
Copy link

Supersedes #1331

@FrankC013 FrankC013 force-pushed the 14.0-fix-account_payment_order-communication branch from cbc15f0 to 196e1c1 Compare October 25, 2024 11:19
Copy link

@eantones eantones left a comment

Choose a reason for hiding this comment

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

@FrankC013 This is 14.0 and it supersedes an already merged 16.0 PR???? It cannot supersedes if it's merged and it's another version. This seems a backport. Please check it out.

@@ -48,7 +48,7 @@ def _get_payment_order_communication(self):
if (self.reference_type or "none") != "none":
communication = self.ref
elif self.is_purchase_document():
communication = self.ref or self.payment_reference
communication = self.payment_reference or self.ref or ""

Choose a reason for hiding this comment

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

Do you really need to add or ""?

Copy link
Author

Choose a reason for hiding this comment

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

I added or "" because, in version 16, the _get_payment_order_communication function is divided into two separate methods: _get_payment_order_communication_direct and _get_payment_order_communication_full.

If I remove the or "", the line communication += " " + " ".join(references) throws the error unsupported operand type(s) for +=: 'bool' and 'str', as self.ref can be False. To avoid this issue, we can either split the function as in version 16 or handle it with or "" to ensure communication is always a string.

Choose a reason for hiding this comment

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

Undestood, thanks @FrankC013

@FrankC013
Copy link
Author

Superseded by #1372

@FrankC013 FrankC013 closed this Oct 28, 2024
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.

2 participants