Files
odoo_source/addons
Anh Thao Pham (pta) 80dcf62086 [FIX] account_payment: fix failed payment transaction from invoice
Steps to reproduce:
- Configure a payment provider (e.g. Stripe)
- Go to the portal account of an user (e.g. Marc Demo)
- Click on "Manage payment methods"
- Save a payment method to create a payment token
- /!\ Go back to payment provider configuration and make a typo in the credentials
(This will be needed later to trigger a payment transaction error)
- Go to Accounting and create an invoice for Marc Demo
- Confirm the invoice
- Register payment:
  * Payment Method: Stripe
  * Saved payment token: [payment token of Marc Demo]
- Create payment

[1st issue]
The payment transaction fails (as the credentials are incorrect),
but no information about it appears on the invoice.

[2nd issue]
It is not possible to register another payment (with the payment provider) because
there is an unique constraint on the reference field of "payment.transaction" model
and each attempt of registering a payment uses the same reference.

Solution:
[1st issue]
Link invoice to payment transaction.
Messages related to payment transaction will be logged on the invoice automatically.

[2nd issue]
Generate reference with "_compute_reference" method instead of always using the same one.

opw-3499200

closes odoo/odoo#140533

X-original-commit: 8c98efe036972c43a95c28509e91c356ddc84084
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
2023-10-31 20:54:05 +00:00
..
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-30 16:41:49 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-25 19:37:35 +00:00
2023-10-26 08:45:57 +00:00
2023-10-25 18:11:01 +00:00
2023-10-10 17:26:34 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-31 15:54:32 +00:00
2023-10-27 08:36:16 +00:00
2023-10-27 08:36:16 +00:00