Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
2d0f78cb54
@ -1,4 +1,8 @@
|
|||||||
erpnext.updates = [
|
erpnext.updates = [
|
||||||
|
["26th November 2012", [
|
||||||
|
"Email: Added User Signature",
|
||||||
|
"Support Ticket: Added link to Lead / Contact. If incoming ticket is not from an existing Lead / Contact, create a new Lead",
|
||||||
|
]],
|
||||||
["24ht November 2012", [
|
["24ht November 2012", [
|
||||||
"Support Ticket: Support Ticket Response is now Communication",
|
"Support Ticket: Support Ticket Response is now Communication",
|
||||||
]],
|
]],
|
||||||
|
@ -70,6 +70,8 @@ MyProfile = function(wrapper) {
|
|||||||
fields: [
|
fields: [
|
||||||
{fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1},
|
{fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1},
|
||||||
{fieldname:'last_name', fieldtype:'Data',label:'Last Name'},
|
{fieldname:'last_name', fieldtype:'Data',label:'Last Name'},
|
||||||
|
{fieldname:'email_signature', fieldtype:'Text',label:'Email Signature',
|
||||||
|
decription:'Will be appended to outgoing mail'},
|
||||||
{fieldname:'bio', fieldtype:'Text',label:'Bio'},
|
{fieldname:'bio', fieldtype:'Text',label:'Bio'},
|
||||||
{fieldname:'update', fieldtype:'Button',label:'Update'}
|
{fieldname:'update', fieldtype:'Button',label:'Update'}
|
||||||
]
|
]
|
||||||
|
@ -63,6 +63,7 @@ def set_user_details(arg=None):
|
|||||||
arg_dict = load_json(arg)
|
arg_dict = load_json(arg)
|
||||||
if not 'bio' in arg_dict: arg_dict['bio'] = None
|
if not 'bio' in arg_dict: arg_dict['bio'] = None
|
||||||
if not 'last_name' in arg_dict: arg_dict['last_name'] = None
|
if not 'last_name' in arg_dict: arg_dict['last_name'] = None
|
||||||
|
if not 'email_signature' in arg_dict: arg_dict['email_signature'] = None
|
||||||
p.fields.update(arg_dict)
|
p.fields.update(arg_dict)
|
||||||
p.save()
|
p.save()
|
||||||
webnotes.msgprint('Updated')
|
webnotes.msgprint('Updated')
|
||||||
|
@ -22,7 +22,7 @@ erpnext.toolbar.setup = function() {
|
|||||||
erpnext.toolbar.add_modules();
|
erpnext.toolbar.add_modules();
|
||||||
|
|
||||||
// profile
|
// profile
|
||||||
$('#toolbar-user').append('<li><a href="#!profile-settings">Profile Settings</a></li>');
|
$('#toolbar-user').append('<li><a href="#!profile-settings">My Settings...</a></li>');
|
||||||
|
|
||||||
$('.navbar .pull-right').append('\
|
$('.navbar .pull-right').append('\
|
||||||
<li><a href="#!messages" title="Unread Messages"><span class="navbar-new-comments"></span></a></li>');
|
<li><a href="#!messages" title="Unread Messages"><span class="navbar-new-comments"></span></a></li>');
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-11-14 12:25:16",
|
"creation": "2012-11-14 12:25:16",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-11-26 11:17:28"
|
"modified": "2012-11-26 12:41:59"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
@ -12,7 +12,7 @@
|
|||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"module": "Support",
|
"module": "Support",
|
||||||
"in_dialog": 1,
|
"in_dialog": 0,
|
||||||
"document_type": "Master",
|
"document_type": "Master",
|
||||||
"description": "Keep a track of all communications"
|
"description": "Keep a track of all communications"
|
||||||
},
|
},
|
||||||
|
@ -100,21 +100,37 @@ class DocType(TransactionBase):
|
|||||||
Creates a new Communication record
|
Creates a new Communication record
|
||||||
"""
|
"""
|
||||||
# add to Communication
|
# add to Communication
|
||||||
import email.utils
|
|
||||||
|
|
||||||
d = webnotes.doc('Communication')
|
d = webnotes.doc('Communication')
|
||||||
d.subject = self.doc.subject
|
d.subject = self.doc.subject
|
||||||
d.email_address = from_email or webnotes.user.name
|
d.email_address = from_email or webnotes.user.name
|
||||||
email_addr = email.utils.parseaddr(d.email_address)[1]
|
self.set_lead_and_contact(d)
|
||||||
d.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr}, "name") or None
|
|
||||||
d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr}, "name") or None
|
|
||||||
d.support_ticket = self.doc.name
|
d.support_ticket = self.doc.name
|
||||||
d.content = response
|
d.content = response
|
||||||
d.communication_medium = "Email"
|
d.communication_medium = "Email"
|
||||||
d.save(1)
|
d.save(1)
|
||||||
|
|
||||||
|
def set_lead_and_contact(self, d):
|
||||||
|
import email.utils
|
||||||
|
email_addr = email.utils.parseaddr(d.email_address)
|
||||||
|
# set contact
|
||||||
|
if self.doc.contact:
|
||||||
|
d.contact = self.doc.contact
|
||||||
|
else:
|
||||||
|
d.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr[1]}, "name") or None
|
||||||
|
if d.contact:
|
||||||
|
webnotes.conn.set(self.doc, "contact", d.contact)
|
||||||
|
|
||||||
|
if self.doc.lead:
|
||||||
|
d.lead = self.doc.lead
|
||||||
|
else:
|
||||||
|
d.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr[1]}, "name") or None
|
||||||
|
if d.lead:
|
||||||
|
webnotes.conn.set(self.doc, "lead", d.lead)
|
||||||
|
|
||||||
|
# not linked to any lead / contact, create new lead
|
||||||
if not d.lead and not d.contact:
|
if not d.lead and not d.contact:
|
||||||
self.make_lead(d, email_addr[0])
|
d.lead = self.make_lead(d, email_addr[0])
|
||||||
|
webnotes.conn.set(self.doc, "lead", d.lead)
|
||||||
|
|
||||||
def make_lead(self, d, real_name):
|
def make_lead(self, d, real_name):
|
||||||
d = webnotes.doc("Lead")
|
d = webnotes.doc("Lead")
|
||||||
@ -122,6 +138,7 @@ class DocType(TransactionBase):
|
|||||||
d.email_id = d.email_address
|
d.email_id = d.email_address
|
||||||
d.source = "Email"
|
d.source = "Email"
|
||||||
d.save(1)
|
d.save(1)
|
||||||
|
return d.name
|
||||||
|
|
||||||
def close_ticket(self):
|
def close_ticket(self):
|
||||||
webnotes.conn.set(self.doc,'status','Closed')
|
webnotes.conn.set(self.doc,'status','Closed')
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-11-02 17:17:05",
|
"creation": "2012-11-02 17:17:05",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-11-26 11:17:10"
|
"modified": "2012-11-26 12:54:25"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
@ -138,6 +138,22 @@
|
|||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
"permlevel": 1
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"label": "Lead",
|
||||||
|
"options": "Lead",
|
||||||
|
"fieldname": "lead",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"permlevel": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"doctype": "DocField",
|
||||||
|
"label": "Contact",
|
||||||
|
"options": "Contact",
|
||||||
|
"fieldname": "contact",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"permlevel": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
@ -166,36 +182,6 @@
|
|||||||
"permlevel": 2,
|
"permlevel": 2,
|
||||||
"in_filter": 1
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"doctype": "DocField",
|
|
||||||
"label": "Address",
|
|
||||||
"fieldname": "address_display",
|
|
||||||
"fieldtype": "Small Text",
|
|
||||||
"permlevel": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"doctype": "DocField",
|
|
||||||
"label": "Contact Name",
|
|
||||||
"fieldname": "contact_display",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"permlevel": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"doctype": "DocField",
|
|
||||||
"label": "Mobile No",
|
|
||||||
"fieldname": "contact_mobile",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"permlevel": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"oldfieldtype": "Data",
|
|
||||||
"doctype": "DocField",
|
|
||||||
"label": "Contact Email",
|
|
||||||
"oldfieldname": "contact_no",
|
|
||||||
"fieldname": "contact_email",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"permlevel": 2
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"default": "Today",
|
"default": "Today",
|
||||||
"oldfieldtype": "Date",
|
"oldfieldtype": "Date",
|
||||||
@ -225,20 +211,6 @@
|
|||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
"permlevel": 1
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"depends_on": "eval:!doc.__islocal",
|
|
||||||
"search_index": 1,
|
|
||||||
"colour": "White:FFF",
|
|
||||||
"doctype": "DocField",
|
|
||||||
"label": "Allocated To",
|
|
||||||
"oldfieldname": "allocated_to",
|
|
||||||
"permlevel": 1,
|
|
||||||
"fieldname": "allocated_to",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"oldfieldtype": "Link",
|
|
||||||
"options": "Profile",
|
|
||||||
"in_filter": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldtype": "Text",
|
"oldfieldtype": "Text",
|
||||||
@ -246,7 +218,7 @@
|
|||||||
"label": "Resolution Details",
|
"label": "Resolution Details",
|
||||||
"oldfieldname": "resolution_details",
|
"oldfieldname": "resolution_details",
|
||||||
"fieldname": "resolution_details",
|
"fieldname": "resolution_details",
|
||||||
"fieldtype": "Text",
|
"fieldtype": "Small Text",
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
"permlevel": 1
|
"permlevel": 1
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user