diff --git a/frappe/__init__.py b/frappe/__init__.py index efacd487f2..818ffc40c5 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template -__version__ = '10.1.48' +__version__ = '10.1.49' __title__ = "Frappe Framework" local = Local() diff --git a/frappe/core/doctype/data_import/data_import.js b/frappe/core/doctype/data_import/data_import.js index 9762663957..ccf773d0cb 100644 --- a/frappe/core/doctype/data_import/data_import.js +++ b/frappe/core/doctype/data_import/data_import.js @@ -13,6 +13,9 @@ frappe.ui.form.on('Data Import', { }; }); + // should never check public + frm.fields_dict["import_file"].df.is_private = 1; + frappe.realtime.on("data_import_progress", function(data) { if (data.data_import === frm.doc.name) { if (data.reload && data.reload === true) { diff --git a/frappe/core/doctype/report/report.py b/frappe/core/doctype/report/report.py index d11d7f0a51..a7b1c4d4dc 100644 --- a/frappe/core/doctype/report/report.py +++ b/frappe/core/doctype/report/report.py @@ -73,6 +73,9 @@ class Report(Document): return True def update_report_json(self): + if not self.json: + self.json = '{}' + if self.json: data = json.loads(self.json) data["add_total_row"] = self.add_total_row @@ -121,7 +124,15 @@ class Report(Document): else: # standard report params = json.loads(self.json) - columns = params.get('columns') + + if params.get('columns'): + columns = params.get('columns') + else: + columns = [['name', self.ref_doctype]] + for df in frappe.get_meta(self.ref_doctype).fields: + if df.in_list_view: + columns.append([df.fieldname, self.ref_doctype]) + _filters = params.get('filters') or [] if filters: @@ -135,7 +146,11 @@ class Report(Document): # sort by is saved as DocType.fieldname, covert it to sql return '`tab{0}`.`{1}`'.format(*parts) - order_by = _format(params.get('sort_by').split('.')) + ' ' + params.get('sort_order') + if params.get('sort_by'): + order_by = _format(params.get('sort_by').split('.')) + ' ' + params.get('sort_order') + else: + order_by = _format(self.ref_doctype, 'modified') + ' desc' + if params.get('sort_by_next'): order_by += ', ' + _format(params.get('sort_by_next').split('.')) + ' ' + params.get('sort_order_next') diff --git a/frappe/email/doctype/email_alert/email_alert.py b/frappe/email/doctype/email_alert/email_alert.py index 1da959956f..eb557fb130 100755 --- a/frappe/email/doctype/email_alert/email_alert.py +++ b/frappe/email/doctype/email_alert/email_alert.py @@ -134,9 +134,10 @@ def get_context(context): if not frappe.safe_eval(recipient.condition, None, context): continue if recipient.email_by_document_field: - if validate_email_add(doc.get(recipient.email_by_document_field)): - recipient.email_by_document_field = doc.get(recipient.email_by_document_field).replace(",", "\n") - recipients = recipients + recipient.email_by_document_field.split("\n") + email_ids_value = doc.get(recipient.email_by_document_field) + if validate_email_add(email_ids_value): + email_ids = email_ids_value.replace(",", "\n") + recipients = recipients + email_ids.split("\n") # else: # print "invalid email" diff --git a/frappe/email/queue.py b/frappe/email/queue.py index f06bfa69eb..8f5a28efac 100755 --- a/frappe/email/queue.py +++ b/frappe/email/queue.py @@ -89,6 +89,13 @@ def send(recipients=None, sender=None, subject=None, message=None, text_content= recipients = [r for r in list(set(recipients)) if r and r not in unsubscribed] + if cc: + cc = [r for r in list(set(cc)) if r and r not in unsubscribed] + + if not recipients and not cc: + # Recipients may have been unsubscribed, exit quietly + return + email_text_context = text_content should_append_unsubscribe = (add_unsubscribe_link diff --git a/frappe/public/js/frappe/ui/base_list.js b/frappe/public/js/frappe/ui/base_list.js index 3a239f5bc0..7999b1b164 100644 --- a/frappe/public/js/frappe/ui/base_list.js +++ b/frappe/public/js/frappe/ui/base_list.js @@ -258,6 +258,7 @@ frappe.ui.BaseList = Class.extend({ clear: function () { this.data = []; + this.wrapper.find('.list-select-all').prop('checked', false); this.wrapper.find('.result-list').empty(); this.wrapper.find('.result').show(); this.wrapper.find('.no-result').hide();