on delete contact update issue (#14770)
* on delete contact update isuue remove contact from issue if the deleted contact exists * moved issue update function to issue.py * Update formatting and comment
This commit is contained in:
parent
27067b34e1
commit
4987c4ef53
@ -210,6 +210,9 @@ doc_events = {
|
|||||||
},
|
},
|
||||||
('Sales Invoice', 'Purchase Invoice', 'Delivery Note'): {
|
('Sales Invoice', 'Purchase Invoice', 'Delivery Note'): {
|
||||||
'validate': 'erpnext.regional.india.utils.set_place_of_supply'
|
'validate': 'erpnext.regional.india.utils.set_place_of_supply'
|
||||||
|
},
|
||||||
|
"Contact":{
|
||||||
|
"on_trash": "erpnext.support.doctype.issue.issue.update_issue"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -130,3 +130,8 @@ def set_multiple_status(names, status):
|
|||||||
|
|
||||||
def has_website_permission(doc, ptype, user, verbose=False):
|
def has_website_permission(doc, ptype, user, verbose=False):
|
||||||
return doc.raised_by==user
|
return doc.raised_by==user
|
||||||
|
|
||||||
|
|
||||||
|
def update_issue(contact, method):
|
||||||
|
"""Called when Contact is deleted"""
|
||||||
|
frappe.db.sql("""UPDATE `tabIssue` set contact='' where contact=%s""", contact.name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user