From 53ecddd6121ec4f19396391ad8157c262a564f15 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 4 Sep 2013 17:52:27 +0530 Subject: [PATCH] [fix] [communication] on communication send, update status --- hr/doctype/job_applicant/job_applicant.py | 2 +- selling/doctype/lead/lead.py | 7 ++++--- support/doctype/support_ticket/support_ticket.py | 7 ++++--- utilities/doctype/contact/contact.py | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hr/doctype/job_applicant/job_applicant.py b/hr/doctype/job_applicant/job_applicant.py index 1603925bd7..981a08bdc2 100644 --- a/hr/doctype/job_applicant/job_applicant.py +++ b/hr/doctype/job_applicant/job_applicant.py @@ -14,7 +14,7 @@ class DocType(TransactionBase): def get_sender(self, comm): return webnotes.conn.get_value('Jobs Email Settings',None,'email_id') - def on_communication_sent(self, comm): + def on_communication(self, comm): if webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User": status = "Replied" else: diff --git a/selling/doctype/lead/lead.py b/selling/doctype/lead/lead.py index d9a631e74b..95c8af8662 100644 --- a/selling/doctype/lead/lead.py +++ b/selling/doctype/lead/lead.py @@ -28,9 +28,10 @@ class DocType(SellingController): if customer: self.doc.fields["__is_customer"] = customer - def on_communication_sent(self, comm): - if webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User": - status = "Replied" + def on_communication(self, comm): + if comm.sender == self.get_sender(comm) or \ + webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User": + status = "Replied" else: status = "Open" diff --git a/support/doctype/support_ticket/support_ticket.py b/support/doctype/support_ticket/support_ticket.py index 6958c74586..66f6867d1c 100644 --- a/support/doctype/support_ticket/support_ticket.py +++ b/support/doctype/support_ticket/support_ticket.py @@ -33,9 +33,10 @@ class DocType(TransactionBase): from webnotes.widgets.form.assign_to import clear clear(self.doc.doctype, self.doc.name) - def on_communication_sent(self, comm): - if webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User": - self.doc.status = "Waiting for Customer" + def on_communication(self, comm): + if comm.sender == self.get_sender(comm) or \ + webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User": + self.doc.status = "Waiting for Customer" else: self.doc.status = "Open" self.update_status() diff --git a/utilities/doctype/contact/contact.py b/utilities/doctype/contact/contact.py index 78c66aecf7..566e857f06 100644 --- a/utilities/doctype/contact/contact.py +++ b/utilities/doctype/contact/contact.py @@ -12,7 +12,7 @@ class DocType(TransactionBase): self.doc = doc self.doclist = doclist - def on_communication_sent(self, comm): + def on_communication(self, comm): if webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User": status = "Replied" else: