From 3313acf58ce4ae2756de1d9fee9c6c18d26fd65e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 18 Jun 2015 15:37:51 +0530 Subject: [PATCH 1/8] minor fix --- frappe/model/base_document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index ddb10f0e5f..1b1116e55b 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -524,7 +524,7 @@ class BaseDocument(object): def cast(self, val, df): if df.fieldtype in ("Currency", "Float", "Percent"): - val = flt(val, self.precision(df.fieldname)) + val = flt(val) elif df.fieldtype in ("Int", "Check"): val = cint(val) From 1137e02447582d0ab3faf944b220ce50f1d8f4c0 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 18 Jun 2015 16:04:26 +0530 Subject: [PATCH 2/8] Auto suggesting tags should not be case sensitive --- frappe/public/js/frappe/ui/tags.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/ui/tags.js b/frappe/public/js/frappe/ui/tags.js index 31699a3c67..ed74e58956 100644 --- a/frappe/public/js/frappe/ui/tags.js +++ b/frappe/public/js/frappe/ui/tags.js @@ -67,7 +67,7 @@ frappe.ui.TagEditor = Class.extend({ method:"frappe.desk.tags.get_tags", args:{ doctype: me.frm.doctype, - txt: request.term + txt: request.term.toLowerCase() }, callback: function(r) { response(r.message); From da2c7c8683dd0dbd7223b74e2d76c9244223e635 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 18 Jun 2015 16:51:50 +0530 Subject: [PATCH 3/8] Show all recipients in sent-to message --- .../doctype/communication/communication.py | 18 +++++++++++------- frappe/public/js/frappe/views/communication.js | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 8163163c18..70f788e569 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -44,14 +44,14 @@ class Communication(Document): frappe.db.set_value(parent.doctype, parent.name, "status", to_status) def send(self, print_html=None, print_format=None, attachments=None, - send_me_a_copy=False): + send_me_a_copy=False, recipients=None): """Send communication via Email. :param print_html: Send given value as HTML attachment. :param print_format: Attach print format of parent document.""" self.send_me_a_copy = send_me_a_copy - self.notify(print_html, print_format, attachments) + self.notify(print_html, print_format, attachments, recipients) def set_incoming_outgoing_accounts(self): self.incoming_email_account = self.outgoing_email_account = None @@ -71,9 +71,10 @@ class Communication(Document): self.outgoing_email_account = frappe.db.get_value("Email Account", {"default_outgoing": 1}, ["email_id", "always_use_account_email_id_as_sender"], as_dict=True) or frappe._dict() - def notify(self, print_html=None, print_format=None, attachments=None, except_recipient=False): + def notify(self, print_html=None, print_format=None, attachments=None, except_recipient=False, recipients=None): self.prepare_to_notify(print_html, print_format, attachments) - recipients = self.get_recipients(except_recipient=except_recipient) + if not recipients: + recipients = self.get_recipients(except_recipient=except_recipient) frappe.sendmail( recipients=recipients, @@ -246,11 +247,14 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received = "reference_name": name }) comm.insert(ignore_permissions=True) - + + recipients = None if send_email: - comm.send(print_html, print_format, attachments, send_me_a_copy=send_me_a_copy) + comm.send_me_a_copy = send_me_a_copy + recipients = comm.get_recipients() + comm.send(print_html, print_format, attachments, send_me_a_copy=send_me_a_copy, recipients=recipients) - return comm.name + return ", ".join(recipients) if recipients else None @frappe.whitelist() def get_convert_to(): diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 1beb94539e..7fc317bb9c 100644 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -328,7 +328,7 @@ frappe.views.CommunicationComposer = Class.extend({ callback: function(r) { if(!r.exc) { if(form_values.send_email) - msgprint(__("Email sent to {0}", [form_values.recipients])); + msgprint(__("Email sent to {0}", [r.message])); me.dialog.hide(); if (cur_frm) { From f7016664cc663b6efb1dac9c778a681cdffef02b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 19 Jun 2015 00:15:53 +0530 Subject: [PATCH 4/8] Show all recipients in sent-to message --- frappe/core/doctype/communication/communication.py | 5 ++++- frappe/email/doctype/email_account/test_email_account.py | 2 +- frappe/public/js/frappe/views/communication.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 70f788e569..11d7af837b 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -254,7 +254,10 @@ def make(doctype=None, name=None, content=None, subject=None, sent_or_received = recipients = comm.get_recipients() comm.send(print_html, print_format, attachments, send_me_a_copy=send_me_a_copy, recipients=recipients) - return ", ".join(recipients) if recipients else None + return { + "name": comm.name, + "recipients": ", ".join(recipients) if recipients else None + } @frappe.whitelist() def get_convert_to(): diff --git a/frappe/email/doctype/email_account/test_email_account.py b/frappe/email/doctype/email_account/test_email_account.py index f09ae9a0bd..c8c8839e19 100644 --- a/frappe/email/doctype/email_account/test_email_account.py +++ b/frappe/email/doctype/email_account/test_email_account.py @@ -90,7 +90,7 @@ class TestEmailAccount(unittest.TestCase): # send sent_name = make(subject = "Test", content="test content", recipients="test_receiver@example.com", sender="test@example.com", - send_email=True) + send_email=True)["name"] sent_mail = email.message_from_string(frappe.get_last_doc("Bulk Email").message) with open(os.path.join(os.path.dirname(__file__), "test_mails", "reply-1.raw"), "r") as f: diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 7fc317bb9c..8b2924abee 100644 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -328,7 +328,7 @@ frappe.views.CommunicationComposer = Class.extend({ callback: function(r) { if(!r.exc) { if(form_values.send_email) - msgprint(__("Email sent to {0}", [r.message])); + msgprint(__("Email sent to {0}", [r.message["recipients"]])); me.dialog.hide(); if (cur_frm) { From 68c3b10350c1e983393ccbc2f44a57dac9b426d7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 18 Jun 2015 15:23:17 -0400 Subject: [PATCH 5/8] [fix] attach document and docfields to layout fields list before triggering refresh event via script manager. Fixes #1158 --- frappe/public/js/frappe/form/layout.js | 32 +++++++++++++++----------- frappe/public/js/legacy/form.js | 3 +++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/frappe/public/js/frappe/form/layout.js b/frappe/public/js/frappe/form/layout.js index 522472756a..10c8bd7c57 100644 --- a/frappe/public/js/frappe/form/layout.js +++ b/frappe/public/js/frappe/form/layout.js @@ -37,19 +37,8 @@ frappe.ui.form.Layout = Class.extend({ this.wrapper.find(".empty-form-alert").remove(); } - for(var i=0, l=this.fields_list.length; i Date: Mon, 22 Jun 2015 09:02:04 +0530 Subject: [PATCH 6/8] [fix] Update comments in parent doctype if comment_doctype mentioned --- frappe/core/doctype/comment/comment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/comment/comment.py b/frappe/core/doctype/comment/comment.py index 57e688a8f6..fa2c8cb37e 100644 --- a/frappe/core/doctype/comment/comment.py +++ b/frappe/core/doctype/comment/comment.py @@ -101,7 +101,7 @@ class Comment(Document): """Updates `_comments` property in parent Document with given dict. :param _comments: Dict of comments.""" - if frappe.db.get_value("DocType", self.comment_doctype, "issingle"): + if not self.comment_doctype or frappe.db.get_value("DocType", self.comment_doctype, "issingle"): return # use sql, so that we do not mess with the timestamp From 42177a5665a46f4d8928fd79ba62479e0b41b7ab Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 22 Jun 2015 19:25:19 +0530 Subject: [PATCH 7/8] [fix] Show all recipients in sent-to message --- frappe/core/doctype/communication/communication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 11d7af837b..5fbf556568 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -71,7 +71,7 @@ class Communication(Document): self.outgoing_email_account = frappe.db.get_value("Email Account", {"default_outgoing": 1}, ["email_id", "always_use_account_email_id_as_sender"], as_dict=True) or frappe._dict() - def notify(self, print_html=None, print_format=None, attachments=None, except_recipient=False, recipients=None): + def notify(self, print_html=None, print_format=None, attachments=None, recipients=None, except_recipient=False): self.prepare_to_notify(print_html, print_format, attachments) if not recipients: recipients = self.get_recipients(except_recipient=except_recipient) From 52624a225434afcbe61df49c4d4f75c7fb7b0607 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 23 Jun 2015 10:55:21 +0600 Subject: [PATCH 8/8] bumped to version 5.0.28 --- frappe/__version__.py | 2 +- frappe/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/__version__.py b/frappe/__version__.py index a8ff913062..2522482b84 100644 --- a/frappe/__version__.py +++ b/frappe/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = "5.0.27" +__version__ = "5.0.28" diff --git a/frappe/hooks.py b/frappe/hooks.py index 26dfcd7140..1698f32861 100644 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -4,7 +4,7 @@ app_title = "Frappe Framework" app_publisher = "Frappe Technologies Pvt. Ltd." app_description = "Full Stack Web Application Framework in Python" app_icon = "octicon octicon-circuit-board" -app_version = "5.0.27" +app_version = "5.0.28" app_color = "orange" app_email = "support@frappe.io" diff --git a/setup.py b/setup.py index f5652a7fa2..4b315b246f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.0.27" +version = "5.0.28" with open("requirements.txt", "r") as f: install_requires = f.readlines()