Cannot deleted because the Sales Invoice "***" is linked to the Sales Invoice

Hi. I created a child Sales Invoice doctype, but when I try to delete the parent doctype (Sales Invoice), I get a message that it cannot be deleted because the Sales Invoice “***” is linked to the Sales Invoice. My question is do I need to do something in my code that will allow me to remove the sales invoice and automatically remove my child document type? Thanks

@Ignais_La_Paz_Trujil I guess overriding the delete function is your solution. which is very difficult and may corrupt your app.

1 Like

Thanks for your answer, but the solution was as easy as changing the name of the linked field in the child doctype, this field was Sales Invoice and I changed it to just Invoice. Maybe it’s something basic that’s in the documentation, but I didn’t know it worked like that.

@Ignais_La_Paz_Trujil you just deleted the link . the parent-child connection is not longer exist

no, I only change the name (sales_invoice to invoice) of the field, but in Options it is still Sales Invoice