Payment deletion fails on cancellation during concurrent edit

Description

If two users edit the same In Progress payment, and both delete it by pressing Cancel, the second user will receive an error like “Failed to delete object with reference act.customerAccountPayment:6483736:62b2d4bc-48a3-11ee-a690-fd749b8b2bae".

To reproduce:
1. Go to Customers - Payments
2. Create an In Progress payment, with a single EFT line item.
3. Click Apply
4. In another window, edit the payment. Click Cancel.
A prompt will be displayed: “This Payment has been saved. Do you want to delete it?”
Click Yes
5. In the first window, Click cancel, and click Yes at the prompt.

An error like the following will be generated (this stack from a 2.4-alpha-14 error report):

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created December 11, 2023 at 11:38 PM
Updated September 4, 2024 at 10:52 PM
Resolved September 4, 2024 at 10:52 PM
Who's Looking?