[minor] communication, webnotes/erpnext#790

This commit is contained in:
Rushabh Mehta 2013-09-04 16:20:18 +05:30
parent 140f9052a9
commit 090d410498
4 changed files with 8 additions and 8 deletions

View File

@ -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)

View File

@ -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();

View File

@ -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

View File

@ -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