[fix] [minor] on_communication, when checking if system user, extract email id and then check
This commit is contained in:
parent
fd5b5c187a
commit
7b044da0e3
@ -6,6 +6,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from utilities.transaction_base import TransactionBase
|
from utilities.transaction_base import TransactionBase
|
||||||
|
from webnotes.utils import extract_email_id
|
||||||
|
|
||||||
class DocType(TransactionBase):
|
class DocType(TransactionBase):
|
||||||
def __init__(self, d, dl):
|
def __init__(self, d, dl):
|
||||||
@ -15,7 +16,7 @@ class DocType(TransactionBase):
|
|||||||
return webnotes.conn.get_value('Jobs Email Settings',None,'email_id')
|
return webnotes.conn.get_value('Jobs Email Settings',None,'email_id')
|
||||||
|
|
||||||
def on_communication(self, comm):
|
def on_communication(self, comm):
|
||||||
if webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User":
|
if webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
|
||||||
status = "Replied"
|
status = "Replied"
|
||||||
else:
|
else:
|
||||||
status = "Open"
|
status = "Open"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes import _
|
from webnotes import _
|
||||||
from webnotes.utils import cstr, validate_email_add, cint
|
from webnotes.utils import cstr, validate_email_add, cint, extract_email_id
|
||||||
from webnotes import session, msgprint
|
from webnotes import session, msgprint
|
||||||
|
|
||||||
sql = webnotes.conn.sql
|
sql = webnotes.conn.sql
|
||||||
@ -30,7 +30,7 @@ class DocType(SellingController):
|
|||||||
|
|
||||||
def on_communication(self, comm):
|
def on_communication(self, comm):
|
||||||
if comm.sender == self.get_sender(comm) or \
|
if comm.sender == self.get_sender(comm) or \
|
||||||
webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User":
|
webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
|
||||||
status = "Replied"
|
status = "Replied"
|
||||||
else:
|
else:
|
||||||
status = "Open"
|
status = "Open"
|
||||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
|||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
from utilities.transaction_base import TransactionBase
|
from utilities.transaction_base import TransactionBase
|
||||||
from webnotes.utils import now
|
from webnotes.utils import now, extract_email_id
|
||||||
|
|
||||||
class DocType(TransactionBase):
|
class DocType(TransactionBase):
|
||||||
def __init__(self, doc, doclist=[]):
|
def __init__(self, doc, doclist=[]):
|
||||||
@ -35,7 +35,7 @@ class DocType(TransactionBase):
|
|||||||
|
|
||||||
def on_communication(self, comm):
|
def on_communication(self, comm):
|
||||||
if comm.sender == self.get_sender(comm) or \
|
if comm.sender == self.get_sender(comm) or \
|
||||||
webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User":
|
webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
|
||||||
self.doc.status = "Waiting for Customer"
|
self.doc.status = "Waiting for Customer"
|
||||||
else:
|
else:
|
||||||
self.doc.status = "Open"
|
self.doc.status = "Open"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import cstr
|
from webnotes.utils import cstr, extract_email_id
|
||||||
|
|
||||||
from utilities.transaction_base import TransactionBase
|
from utilities.transaction_base import TransactionBase
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ class DocType(TransactionBase):
|
|||||||
self.doclist = doclist
|
self.doclist = doclist
|
||||||
|
|
||||||
def on_communication(self, comm):
|
def on_communication(self, comm):
|
||||||
if webnotes.conn.get_value("Profile", comm.sender, "user_type")=="System User":
|
if webnotes.conn.get_value("Profile", extract_email_id(comm.sender), "user_type")=="System User":
|
||||||
status = "Replied"
|
status = "Replied"
|
||||||
else:
|
else:
|
||||||
status = "Open"
|
status = "Open"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user