Merge branch 'master' into perpetual

This commit is contained in:
Nabin Hait
2013-09-03 11:26:02 +05:30
99 changed files with 25 additions and 13 deletions

View File

@@ -12,9 +12,6 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
lead_name = webnotes.conn.get_value("Lead", {"email_id": sender})
contact_name = webnotes.conn.get_value("Contact", {"email_id": sender})
parent_doctype = "Contact" if contact_name else "Lead"
parent_name = contact_name or lead_name
if not (lead_name or contact_name):
# none, create a new Lead
lead = webnotes.bean({
@@ -28,6 +25,9 @@ def add_sales_communication(subject, content, sender, real_name, mail=None,
lead.insert()
lead_name = lead.doc.name
parent_doctype = "Contact" if contact_name else "Lead"
parent_name = contact_name or lead_name
message = make(content=content, sender=sender, subject=subject,
doctype = parent_doctype, name = parent_name, date=date)

View File

@@ -51,7 +51,7 @@ erpnext.LeadController = wn.ui.form.Controller.extend({
}
cur_frm.communication_view = new wn.views.CommunicationList({
list: wn.model.get("Communication", {"lead": this.frm.doc.name}),
list: wn.model.get("Communication", {"parenttype": "Lead", "parent":this.frm.doc.name}),
parent: this.frm.fields_dict.communication_html.wrapper,
doc: this.frm.doc,
recipients: this.frm.doc.email_id