Merge branch 'hotfix'

This commit is contained in:
Ameya Shenoy 2018-09-26 07:12:27 +00:00
commit f1fa88192a
No known key found for this signature in database
GPG key ID: AC016A555657D0A3
6 changed files with 33 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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