From ced5ae0af041bec266abd5f52535475521f4f9e3 Mon Sep 17 00:00:00 2001 From: Maxwell Date: Thu, 29 Aug 2013 17:48:26 -0300 Subject: [PATCH 1/3] Fix Translation in Field Description --- public/js/wn/form/control.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/wn/form/control.js b/public/js/wn/form/control.js index 193e940d52..d7d3fc18a8 100644 --- a/public/js/wn/form/control.js +++ b/public/js/wn/form/control.js @@ -225,7 +225,7 @@ wn.ui.form.ControlInput = wn.ui.form.Control.extend({ if(this.only_input || this.df.description===this._description) return; if(this.df.description) { - this.$wrapper.find(".help-box").html(this.df.description); + this.$wrapper.find(".help-box").html(wn._(this.df.description)); } else { this.set_empty_description(); } @@ -807,4 +807,4 @@ wn.ui.form.fieldtype_icons = { "Datetime": "icon-time", "Code": "icon-code", "Select": "icon-flag" -}; \ No newline at end of file +}; From b330307b455b163fdc93852ddfe7a823c15fdafe Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 30 Aug 2013 10:51:33 +0530 Subject: [PATCH 2/3] [fix] [minor] communication via --- core/doctype/communication/communication.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/doctype/communication/communication.py b/core/doctype/communication/communication.py index 9f03e2d6dd..f4e2aafb87 100644 --- a/core/doctype/communication/communication.py +++ b/core/doctype/communication/communication.py @@ -71,7 +71,9 @@ def make(doctype=None, name=None, content=None, subject=None, d.creation = date if doctype: sent_via = webnotes.get_obj(doctype, name) - d.fields[doctype.replace(" ", "_").lower()] = name + fieldname = doctype.replace(" ", "_").lower() + if comm.meta.get_field(fieldname): + d.fields[fieldname] = name if set_lead: set_lead_and_contact(d) From ecc14fd77fef6d0a674865e799766bd9bc10b0ea Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 30 Aug 2013 11:13:43 +0530 Subject: [PATCH 3/3] [fix] [communication] [minor] set lead and contact --- core/doctype/communication/communication.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/doctype/communication/communication.py b/core/doctype/communication/communication.py index f4e2aafb87..e4c28f0a02 100644 --- a/core/doctype/communication/communication.py +++ b/core/doctype/communication/communication.py @@ -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]},