From a601360d5e26beb1bbc7ab8f7e80c11bc1656890 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Wed, 26 Apr 2017 14:55:40 +0530 Subject: [PATCH 01/20] remove awesomplete filtering frappe/erpnext#8275 (#3071) --- frappe/public/js/frappe/form/control.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index f7a986d6f4..0345a51024 100755 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -1343,10 +1343,7 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({ }; }, filter: function(item, input) { - var d = this.get_item(item.value); - return Awesomplete.FILTER_CONTAINS(d.value, '__link_option') || - Awesomplete.FILTER_CONTAINS(d.value, input) || - Awesomplete.FILTER_CONTAINS(d.description, input); + return true; }, item: function (item, input) { d = this.get_item(item.value); From 9ed4ce4a36953dae3916b06de4a9cf4a3e214494 Mon Sep 17 00:00:00 2001 From: slushpuppy Date: Wed, 26 Apr 2017 17:29:35 +0800 Subject: [PATCH 02/20] Fix for localhost SMTP servers without authentication (#3139) * Update email_account.py Fix for passwordless localhost SMTP servers * Update smtp.py * Update smtp.py Updated * Update smtp.py Syntax error fix * Update email_account.py --- frappe/email/doctype/email_account/email_account.py | 4 ++-- frappe/email/smtp.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frappe/email/doctype/email_account/email_account.py b/frappe/email/doctype/email_account/email_account.py index b330b1570d..5789848e97 100755 --- a/frappe/email/doctype/email_account/email_account.py +++ b/frappe/email/doctype/email_account/email_account.py @@ -61,7 +61,7 @@ class EmailAccount(Document): if (not self.awaiting_password and not frappe.local.flags.in_install and not frappe.local.flags.in_patch): - if self.password: + if self.password or self.smtp_server in ('127.0.0.1' or 'localhost'): if self.enable_incoming: self.get_incoming_server() self.no_failed = 0 @@ -716,4 +716,4 @@ def get_max_email_uid(email_account): return 1 else: max_uid = int(result[0].get("uid", 0)) + 1 - return max_uid \ No newline at end of file + return max_uid diff --git a/frappe/email/smtp.py b/frappe/email/smtp.py index 8daedc567c..4e58beeebc 100644 --- a/frappe/email/smtp.py +++ b/frappe/email/smtp.py @@ -59,7 +59,10 @@ def get_outgoing_email_account(raise_exception_not_set=True, append_to=None): if email_account: if email_account.enable_outgoing and not getattr(email_account, 'from_site_config', False): - email_account.password = email_account.get_password() + raise_exception = True + if email_account.smtp_server in ['localhost','127.0.0.1']: + raise_exception = False + email_account.password = email_account.get_password(raise_exception=raise_exception) email_account.default_sender = email.utils.formataddr((email_account.name, email_account.get("email_id"))) frappe.local.outgoing_email_account[append_to or "default"] = email_account From 4832c3b50f660b3b6d7dfc398391669deac1520b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 25 Apr 2017 14:19:10 +0530 Subject: [PATCH 03/20] [fix] missing first column in HTML for auto_email_report --- .../doctype/auto_email_report/auto_email_report.py | 13 +++++++++---- frappe/model/db_query.py | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frappe/email/doctype/auto_email_report/auto_email_report.py b/frappe/email/doctype/auto_email_report/auto_email_report.py index 2f0c5c19f9..a6238865ff 100644 --- a/frappe/email/doctype/auto_email_report/auto_email_report.py +++ b/frappe/email/doctype/auto_email_report/auto_email_report.py @@ -40,7 +40,7 @@ class AutoEmailReport(Document): count = frappe.db.sql('select count(*) from `tabAuto Email Report` where user=%s and enabled=1', self.user)[0][0] if count > max_reports_per_user + (-1 if self.flags.in_insert else 0): frappe.throw(_('Only {0} emailed reports are allowed per user').format(max_reports_per_user)) - + def validate_report_format(self): """ check if user has select correct report format """ valid_report_formats = ["HTML", "XLS", "CSV"] @@ -59,6 +59,11 @@ class AutoEmailReport(Document): columns, data = report.get_data(limit=self.no_of_rows or 100, user = self.user, filters = self.filters, as_dict=True) + # add serial numbers + columns.insert(0, frappe._dict(fieldname='idx', label='', width='30px')) + for i in range(len(data)): + data[i]['idx'] = i+1 + if len(data)==0 and self.send_if_data: return None @@ -77,7 +82,7 @@ class AutoEmailReport(Document): def get_html_table(self, columns, data): return frappe.render_template('frappe/templates/includes/print_table.html', { 'columns': columns, - 'data': data[1:] + 'data': data }) def get_csv(self, columns, data): @@ -96,7 +101,7 @@ class AutoEmailReport(Document): def send(self): if self.filter_meta and not self.filters: frappe.throw(_("Please set filters value in Report Filter table.")) - + data = self.get_report_content() if not data: return @@ -135,7 +140,7 @@ class AutoEmailReport(Document): def get_report_footer(self): return """

- View report in your browser: + View report in your browser: {{report_name}}

Edit Auto Email Report Settings: {{edit_report_settings}}

""" diff --git a/frappe/model/db_query.py b/frappe/model/db_query.py index e0140c5d53..9361e807db 100644 --- a/frappe/model/db_query.py +++ b/frappe/model/db_query.py @@ -73,7 +73,7 @@ class DatabaseQuery(object): self.user = user or frappe.session.user self.update = update self.user_settings_fields = copy.deepcopy(self.fields) - # self.debug = True + #self.debug = True if user_settings: self.user_settings = json.loads(user_settings) From b6c36a67b0031ffaac56cd8f508ff757ee54d20b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 26 Apr 2017 15:31:10 +0530 Subject: [PATCH 04/20] [fix] filter_dashboard naming #3158 #3128 --- .../public/js/frappe/ui/filters/filter_dashboard_head.html | 6 +++--- frappe/public/js/frappe/ui/filters/filters.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html b/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html index b4c61949ce..b2008394be 100644 --- a/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html +++ b/frappe/public/js/frappe/ui/filters/filter_dashboard_head.html @@ -1,6 +1,6 @@
-
{{ label }}
+
{{ label }}
{% if (type!=="Date" && type!=="Datetime" && type!=="DateRange") { %}