Browse Source

Ignore cancelled linked doc on delete_doc

version-14
Nabin Hait 11 years ago
parent
commit
e77cad5beb
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      frappe/model/delete_doc.py

+ 1
- 1
frappe/model/delete_doc.py View File

@@ -89,7 +89,7 @@ def check_if_doc_is_linked(dt, dn, method="Delete"):
item = frappe.db.get_value(link_dt, {link_field:dn}, item = frappe.db.get_value(link_dt, {link_field:dn},
["name", "parent", "parenttype", "docstatus"], as_dict=True) ["name", "parent", "parenttype", "docstatus"], as_dict=True)
if item and item.parent != dn and (method=="Delete" or
if item and item.parent != dn and ((method=="Delete" and item.docstatus<2) or
(method=="Cancel" and item.docstatus==1)): (method=="Cancel" and item.docstatus==1)):
frappe.msgprint(method + " " + _("Error") + ":"+\ frappe.msgprint(method + " " + _("Error") + ":"+\
("%s (%s) " % (dn, dt)) + _("is linked in") + (" %s (%s)") % ("%s (%s) " % (dn, dt)) + _("is linked in") + (" %s (%s)") %


Loading…
Cancel
Save