How to cancel draft Purchase Order

Because of ERPNext’s forced linking of sales order and purchase order on drop ship we ran into following edge case.

  • created sales order and submitted
  • created purchase order from sales order, but was left as draft
  • customer requirements change required Cancel and Amend Sales Order which was submitted
  • new Purchase Order with new number generated from amended Sales Order
  • want to cancel original Purchase Order which was sent so received by supplier, but option not available ONLY DELETE as submit not allowed because linked to canceled sales order

Need to keep trace and history of this PO, but do not want to leave forever as draft. Never a good idea to delete transactions which create gap in naming series sequence as raises flags with auditors. Choice at this time is to go directly into database and change status to canceled, but not ideal procedure.

Alternative solutions?

Thanks in advance

As strange as it sound, try submitting then cancelling, this will save the PO. For example PUR-ORD-2019-00016 will be saved as PUR-ORD-2019-00016-1.

Will not allow submit because
Cannot link cancelled document: Row #1: Sales Order: ON-00177-1, Row #2: Sales Order: ON-00177-1, Row #3: Sales Order: ON-00177-1, Row #4: Sales Order: ON-00177-1, Row #5: Sales Order: ON-00177-1, Row #6: Sales Order: ON-00177-1, Row #7: Sales Order: ON-00177-1

Do you have an answer here? How can you cancel a draft linked transaction if the parent transaction is already cancelled? example: You want to cancel draft Sales Invoice but the Sales Order was cancelled first.

Is it ERPNext should not have execute the cancellation of a parent transaction if there are still draft transaction/ open transaction linked to it?

As far as I know this issue is not solved. I had to go into database directly to resolve the business logic issue developers have not addressed.

Thank you. I hope this could be solved. Cancel button should not be visible if there are draft linked transactions.