Frappe method to cancel a document

Hi,

is there any method to cancel a document safely ?

because i have create a new apps called Giro , and m Giro have link to JV … so its make they cant be cancelled…i want when the GIro is cancelled so the JV is cancelled as well and other wise…

Thanks

FIrst you have to delete JV then delete ‘Giro’ apps.

i.e First you delete all dependencies which is link with your ‘Giro’ apps and then delete ‘Giro’ apps.

Geetanjali Shitole
New Indictrans Technologies Pvt. Ltd.

Hi…

here was my problem…
when i want to cancel the JV its error and said its link to the Giro…
when i want to cancel the GIro its error and said its linked to a JV

so i cant cancel the document… is there anyway ?

In on_trash - you can unlink your document before deleting.

1 Like

in JV on_trash ?..
or in Giro on_trash ?

am i just supposed to remove the column that kept the link?

Thanks

Hi,

im tried to have on_trash fucntion on giro.py but its doest seem to be called… and im tried to have hooks :
doc_events = {
“Journal Voucher”: {
“on_submit”: “accounting_addons.giro.doctype.giro.giro.on_jv_update”,
"on_cancel": "accounting_addons.giro.doctype.giro.giro.on_trash_jv"
}
}
and that seems to be not being called to…im intended to unlink the document on JV cancel this way…

please help

thanks

On trash is called before links are checked:

1 Like