[fix] [communication] [minor] set lead and contact
This commit is contained in:
parent
b330307b45
commit
ecc14fd77f
1 changed files with 6 additions and 1 deletions
|
|
@ -35,6 +35,7 @@ class DocType():
|
|||
else:
|
||||
parent.doc.status = "Open"
|
||||
|
||||
|
||||
parent.ignore_permissions = True
|
||||
parent.save()
|
||||
|
||||
|
|
@ -136,10 +137,14 @@ def send_comm_email(d, name, sent_via=None, print_html=None, attachments='[]', s
|
|||
|
||||
if sent_via and hasattr(sent_via, 'on_communication_sent'):
|
||||
sent_via.on_communication_sent(d)
|
||||
|
||||
|
||||
def set_lead_and_contact(d):
|
||||
import email.utils
|
||||
email_addr = email.utils.parseaddr(d.sender)
|
||||
|
||||
if webnotes.conn.get_value("Profile", email_addr[1], "user_type")=="System User":
|
||||
email_addr = email.utils.parseaddr(d.recipients)
|
||||
|
||||
# set contact
|
||||
if not d.contact:
|
||||
d.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr[1]},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue