From 0d0d01f8ff6263bc6b70bc9aa11f0f26d33be1cc Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 2 Sep 2013 17:59:43 +0530 Subject: [PATCH] [communication] [minor] --- core/doctype/communication/communication.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/core/doctype/communication/communication.py b/core/doctype/communication/communication.py index 57da429950..83a22a95e3 100644 --- a/core/doctype/communication/communication.py +++ b/core/doctype/communication/communication.py @@ -10,20 +10,12 @@ class DocType(): self.doclist = doclist def get_parent_bean(self): - parent_doctype = None - if self.doc.contact: - parent_doctype = "Contact" - parent_name = self.doc.contact - elif self.doc.lead: - parent_doctype = "Lead" - parent_name = self.doc.lead - - if parent_doctype: - return webnotes.bean(parent_doctype, parent_name) - + if self.doc.doctype: + return webnotes.bean(self.doc.parenttype, self.doc.parent) + def on_update(self): """update status of parent Lead or Contact based on who is replying""" - if self.doc.support_ticket: + if self.doc.parenttype=="Support Ticket" # do nothing - handled by support ticket return