[mailbox] removed separate email settings for jobs, sales, support

This commit is contained in:
Rushabh Mehta
2014-09-15 16:59:38 +05:30
parent 7fb79f6062
commit 5cdc8e560c
32 changed files with 106 additions and 651 deletions

View File

@@ -8,28 +8,16 @@ from frappe import msgprint, _, throw
from frappe.model.document import Document
status_map = {
"Contact": [
["Replied", "communication_sent"],
["Open", "communication_received"]
],
"Job Applicant": [
["Replied", "communication_sent"],
["Open", "communication_received"]
],
"Lead": [
["Replied", "communication_sent"],
["Converted", "has_customer"],
["Opportunity", "has_opportunity"],
["Open", "communication_received"],
],
"Opportunity": [
["Draft", None],
["Submitted", "eval:self.docstatus==1"],
["Lost", "eval:self.status=='Lost'"],
["Quotation", "has_quotation"],
["Replied", "communication_sent"],
["Cancelled", "eval:self.docstatus==2"],
["Open", "communication_received"],
],
"Quotation": [
["Draft", None],
@@ -46,10 +34,6 @@ status_map = {
["Stopped", "eval:self.status=='Stopped'"],
["Cancelled", "eval:self.docstatus==2"],
],
"Support Ticket": [
["Replied", "communication_sent"],
["Open", "communication_received"]
],
}
class StatusUpdater(Document):
@@ -90,25 +74,6 @@ class StatusUpdater(Document):
if update:
frappe.db.set_value(self.doctype, self.name, "status", self.status)
def on_communication(self):
if not self.get("communications"): return
self.communication_set = True
self.get("communications").sort(key=lambda d: d.creation)
self.set_status(update=True)
del self.communication_set
def communication_received(self):
if getattr(self, "communication_set", False):
last_comm = self.get("communications")
if last_comm:
return last_comm[-1].sent_or_received == "Received"
def communication_sent(self):
if getattr(self, "communication_set", False):
last_comm = self.get("communications")
if last_comm:
return last_comm[-1].sent_or_received == "Sent"
def validate_qty(self):
"""
Validates qty at row level