From 090d410498a4590e7f71933a1264d7ce1dad15fa Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 4 Sep 2013 16:20:18 +0530 Subject: [PATCH] [minor] communication, webnotes/erpnext#790 --- home/__init__.py | 3 +-- selling/doctype/quotation/quotation.js | 4 ++-- support/doctype/support_ticket/get_support_mails.py | 7 ++++--- utilities/doctype/contact/contact.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/home/__init__.py b/home/__init__.py index 086179813a..9667efd212 100644 --- a/home/__init__.py +++ b/home/__init__.py @@ -88,5 +88,4 @@ def update_feed(controller, method=None): if method in ['on_update', 'on_submit']: subject, color = feed_dict.get(doc.doctype, [None, None]) if subject: - from webnotes.utils import encode_dict - make_feed('', doc.doctype, doc.name, doc.owner, subject % encode_dict(doc.fields.copy()), color) + make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color) diff --git a/selling/doctype/quotation/quotation.js b/selling/doctype/quotation/quotation.js index fcebe357f8..ea1b62aa0a 100644 --- a/selling/doctype/quotation/quotation.js +++ b/selling/doctype/quotation/quotation.js @@ -62,11 +62,11 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ if (!doc.__islocal) { cur_frm.communication_view = new wn.views.CommunicationList({ - list: wn.model.get("Communication", {"quotation": doc.name}), + list: wn.model.get("Communication", {"parent": doc.name, "parenttype": "Quotation"}), parent: cur_frm.fields_dict.communication_html.wrapper, doc: doc, recipients: doc.contact_email - }); + }); } this.quotation_to(); diff --git a/support/doctype/support_ticket/get_support_mails.py b/support/doctype/support_ticket/get_support_mails.py index fb26e570d7..fa4f304e53 100644 --- a/support/doctype/support_ticket/get_support_mails.py +++ b/support/doctype/support_ticket/get_support_mails.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import webnotes -from webnotes.utils import cstr, cint +from webnotes.utils import cstr, cint, decode_dict from webnotes.utils.email_lib import sendmail from webnotes.utils.email_lib.receive import POP3Mailbox from core.doctype.communication.communication import make @@ -31,14 +31,15 @@ class SupportMailbox(POP3Mailbox): ticket.doc.save() else: - ticket = webnotes.bean([{ + ticket = webnotes.bean([decode_dict({ "doctype":"Support Ticket", "description": mail.content, "subject": mail.subject, "raised_by": mail.from_email, "content_type": mail.content_type, "status": "Open", - }]) + })]) + ticket.insert() new_ticket = True diff --git a/utilities/doctype/contact/contact.js b/utilities/doctype/contact/contact.js index 608b1e7c56..3b5255ccc6 100644 --- a/utilities/doctype/contact/contact.js +++ b/utilities/doctype/contact/contact.js @@ -5,7 +5,7 @@ wn.require('app/controllers/js/contact_address_common.js'); cur_frm.cscript.refresh = function(doc) { cur_frm.communication_view = new wn.views.CommunicationList({ - list: wn.model.get("Communication", {"contact": doc.name}), + list: wn.model.get("Communication", {"parent": doc.name, "parenttype": "Contact"}), parent: cur_frm.fields_dict.communication_html.wrapper, doc: doc, recipients: doc.email_id