Creating credit memo fails on second try (after reversing first one)

Description

when after creating a credit memo this one has to be reversed due to errors trying to create a new one fails with "Credit Memo already exists". I think it should be allowed to create a new one if the first try got reversed.

Environment

None

Activity

Show:
Carlos Ruiz
October 8, 2020, 11:06 AM

Lowering priority as the second credit memo can be created manually.

I have not reviewed code, but maybe the solution is easy, when reversing the credit memo, clear the field that makes the relationship in the original invoice.

Martin Schönbeck
October 8, 2020, 12:52 PM

Hi ,
I was not sure, when to assign which priority. Perhaps we could add a short info in https://wiki.idempiere.org/en/Bug_Reporting_Guidelines to give an idea.

I just had a look at IncoiceCreateCreditMemo.java and saw that the old credit memo is read before issuing the error. So I think the best way could be to simply ignore the already assigned RelatedInvoice_ID if it shows that the credit memo is not valid any longer. This way the connection doesn’t get lost until a new credit memo is created.

Regards,
Martin

Carlos Ruiz
October 8, 2020, 1:35 PM

Hi , priorities are described at https://wiki.idempiere.org/en/Bug_Triage (would be good to add a link in the page you linked).

Your solution sounds OK also, just I'm not sure if is worthy to preserve a link to a document that is not valid anymore. But in principle both would work.

Regards,

Carlos Ruiz

Martin Schönbeck
October 8, 2020, 9:41 PM

Hi , I think it’s easier to find out what happened to a credit memo if somebody else did the reversing. But the main reason to suggest this solution is, that it’s least intrusive.

Regards,
Martin

Carlos Ruiz
October 9, 2020, 9:33 AM

Yes, both solutions look fine, I agree with any of those.

Assignee

Unassigned

Reporter

Martin Schönbeck

Labels

None

Tested By

None

Affects versions

Priority

Minor
Configure