From 01d69b67c72e04d5ce1d57d86946e12fdc8e208f Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Fri, 17 Sep 2021 11:59:05 +0530 Subject: [PATCH 01/37] feat: automatically reload web pages whenever JS/CSS assets are rebuilt --- esbuild/esbuild.js | 10 ++++++++-- frappe/build.py | 3 +++ .../js/frappe/build_events/BuildSuccess.vue | 17 +++++++++++++---- .../frappe/build_events/build_events.bundle.js | 5 +++-- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/esbuild/esbuild.js b/esbuild/esbuild.js index 9074beae06..b0ed92f9ec 100644 --- a/esbuild/esbuild.js +++ b/esbuild/esbuild.js @@ -44,6 +44,11 @@ let argv = yargs type: "boolean", description: "Run in watch mode and rebuild on file changes" }) + .option("auto-reload", { + type: "boolean", + description: `Automatically reload webpages when assets are rebuilt. + Can only be used with the --watch flag.` + }) .option("production", { type: "boolean", description: "Run build in production mode" @@ -475,7 +480,8 @@ async function notify_redis({ error, success }) { } if (success) { payload = { - success: true + success: true, + autoreload: argv["auto-reload"] }; } @@ -528,4 +534,4 @@ function log_rebuilt_assets(prev_assets, new_assets) { log(" " + filename); } log(); -} \ No newline at end of file +} diff --git a/frappe/build.py b/frappe/build.py index dfbe20f31e..ec092d4b57 100644 --- a/frappe/build.py +++ b/frappe/build.py @@ -235,6 +235,9 @@ def watch(apps=None): if apps: command += " --apps {apps}".format(apps=apps) + if frappe.conf.autoreload_on_build: + command += " --auto-reload" + check_node_executable() frappe_app_path = frappe.get_app_path("frappe", "..") frappe.commands.popen(command, cwd=frappe_app_path, env=get_node_env()) diff --git a/frappe/public/js/frappe/build_events/BuildSuccess.vue b/frappe/public/js/frappe/build_events/BuildSuccess.vue index 75a365fdc2..d489c4a1a3 100644 --- a/frappe/public/js/frappe/build_events/BuildSuccess.vue +++ b/frappe/public/js/frappe/build_events/BuildSuccess.vue @@ -3,8 +3,11 @@ v-if="is_shown" class="flex justify-between build-success-message align-center" > -
Compiled successfully
- + Compiled successfully + Refresh @@ -14,11 +17,17 @@ export default { name: "BuildSuccess", data() { return { - is_shown: false + is_shown: false, + autoreload: false, }; }, methods: { - show() { + show(data) { + if (data.autoreload) { + this.autoreload = true; + this.reload(); + } + this.is_shown = true; if (this.timeout) { clearTimeout(this.timeout); diff --git a/frappe/public/js/frappe/build_events/build_events.bundle.js b/frappe/public/js/frappe/build_events/build_events.bundle.js index 6c8986af3f..13b9c7a334 100644 --- a/frappe/public/js/frappe/build_events/build_events.bundle.js +++ b/frappe/public/js/frappe/build_events/build_events.bundle.js @@ -13,10 +13,11 @@ frappe.realtime.on("build_event", data => { } }); -function show_build_success() { +function show_build_success(data) { if (error) { error.hide(); } + if (!success) { let target = $('
') .appendTo($container) @@ -27,7 +28,7 @@ function show_build_success() { }); success = vm.$children[0]; } - success.show(); + success.show(data); } function show_build_error(data) { From 096700a77aaf74e66c7e795a42ba69869d41bf96 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 12 Oct 2021 19:11:25 +0530 Subject: [PATCH 02/37] fix: Loading state for query reports --- .../js/frappe/views/reports/query_report.js | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 7d68919821..8a50a516af 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -107,7 +107,6 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { } if (this.report_name !== frappe.get_route()[1]) { - // this.toggle_loading(true); // different report this.load_report(); } @@ -556,6 +555,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { refresh() { this.toggle_message(true); this.toggle_report(false); + this.show_loading_indicator(); let filters = this.get_filter_values(true); // only one refresh at a time @@ -645,6 +645,8 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { this.show_footer_message(); frappe.hide_progress(); + }).finally(() => { + this.hide_loading_indicator(); }); } @@ -869,6 +871,22 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { } } + show_loading_indicator() { + this.$loading.find('div').html(`
+
+ Generic Empty State +
+

${__('Loading')}...

+
`); + this.$report.hide(); + this.$loading.show(); + } + + hide_loading_indicator() { + this.$loading.hide(); + this.$report.show(); + } + get_chart_options(data) { let options = this.report_settings.get_chart_data ? this.report_settings.get_chart_data(data.columns, data.result) @@ -1679,6 +1697,9 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { .hide().appendTo(this.page.main); this.$chart = $('
').hide().appendTo(this.page.main); + + this.$loading = $(this.message_div('')).hide().appendTo(this.page.main); + this.$report = $('
').appendTo(this.page.main); this.$message = $(this.message_div('')).hide().appendTo(this.page.main); } @@ -1738,11 +1759,6 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { this.refresh(); } - toggle_loading(flag) { - this.toggle_message(flag, __('Loading') + '...'); - } - - toggle_nothing_to_show(flag) { let message = this.prepared_report ? __('This is a background report. Please set the appropriate filters and then generate a new one.') From cb4b9868d3b49fa260a14d53c9b71f7cd838df7a Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Tue, 12 Oct 2021 13:31:09 +0530 Subject: [PATCH 03/37] chore: Try on FCloud button --- .github/try-on-f-cloud-button.svg | 32 +++++++++++++++++++++++++++++++ README.md | 7 +++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/try-on-f-cloud-button.svg diff --git a/.github/try-on-f-cloud-button.svg b/.github/try-on-f-cloud-button.svg new file mode 100644 index 0000000000..fe0bb2c52d --- /dev/null +++ b/.github/try-on-f-cloud-button.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index f8a1907da2..ef471aa05a 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,12 @@ Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for [ERPNext](https://erpnext.com) + + ## Table of Contents * [Installation](#installation) * [Contributing](#contributing) @@ -46,6 +52,7 @@ Full-stack web application framework that uses Python and MariaDB on the server * [Install via Docker](https://github.com/frappe/frappe_docker) * [Install via Frappe Bench](https://github.com/frappe/bench) * [Offical Documentation](https://frappeframework.com/docs/user/en/installation) +* [Managed Hosting on Frappe Cloud](https://frappecloud.com/deploy?apps=frappe&source=frappe_readme) ## Contributing From 2bebf4b2c0e73f117664e7673d63928cac9bff35 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Sep 2021 15:10:21 +0530 Subject: [PATCH 04/37] refactor: convert core communication db.sql calls --- .../doctype/communication/communication.py | 2 +- frappe/core/doctype/communication/mixins.py | 24 ++----------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 66bb3909da..bd33189d58 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -255,7 +255,7 @@ class Communication(Document, CommunicationEmailMixin): def set_delivery_status(self, commit=False): '''Look into the status of Email Queue linked to this Communication and set the Delivery Status of this Communication''' delivery_status = None - status_counts = Counter(frappe.db.sql_list('''select status from `tabEmail Queue` where communication=%s''', self.name)) + status_counts = Counter(frappe.get_all("Email Queue", pluck="status", filters={"communication": self.name})) if self.sent_or_received == "Received": return diff --git a/frappe/core/doctype/communication/mixins.py b/frappe/core/doctype/communication/mixins.py index 52cd370890..b6d8070d00 100644 --- a/frappe/core/doctype/communication/mixins.py +++ b/frappe/core/doctype/communication/mixins.py @@ -217,17 +217,7 @@ class CommunicationEmailMixin: if not emails: return [] - disabled_users = frappe.db.sql_list(""" - SELECT - email - FROM - `tabUser` - where - email in %(emails)s - and - thread_notify=0 - """, {'emails': tuple(emails)}) - return disabled_users + return frappe.get_all("User", pluck="email", filters={"email": ["in", emails], "thread_notify": 0}) @staticmethod def filter_disabled_users(emails): @@ -236,17 +226,7 @@ class CommunicationEmailMixin: if not emails: return [] - disabled_users = frappe.db.sql_list(""" - SELECT - email - FROM - `tabUser` - where - email in %(emails)s - and - enabled=0 - """, {'emails': tuple(emails)}) - return disabled_users + return frappe.get_all("User", pluck="email", filters={"email": ["in", emails], "enabled": 0}) def sendmail_input_dict(self, print_html=None, print_format=None, send_me_a_copy=None, print_letterhead=None, is_inbound_mail_communcation=None): From a81a0d16c27db7fcb9276cfa925a25867e75beb1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Sep 2021 15:11:17 +0530 Subject: [PATCH 05/37] refactor: convert doctype data_export db.sql calls --- frappe/core/doctype/data_export/exporter.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/data_export/exporter.py b/frappe/core/doctype/data_export/exporter.py index 7c660c7180..c5cf67ba57 100644 --- a/frappe/core/doctype/data_export/exporter.py +++ b/frappe/core/doctype/data_export/exporter.py @@ -261,6 +261,7 @@ class DataExporter: self.writer.writerow([self.data_keys.data_separator]) def add_data(self): + from frappe.query_builder import DocType if self.template and not self.with_data: return @@ -305,9 +306,15 @@ class DataExporter: if self.all_doctypes: # add child tables for c in self.child_doctypes: - for ci, child in enumerate(frappe.db.sql("""select * from `tab{0}` - where parent=%s and parentfield=%s order by idx""".format(c['doctype']), - (doc.name, c['parentfield']), as_dict=1)): + child_doctype_table = DocType(c["doctype"]) + data_row = ( + frappe.qb.from_(child_doctype_table) + .select("*") + .where(child_doctype_table.parent == doc.name) + .where(child_doctype_table.parentfield == c["parentfield"]) + .orderby(child_doctype_table.idx) + ) + for ci, child in enumerate(data_row.run()): self.add_data_row(rows, c['doctype'], c['parentfield'], child, ci) for row in rows: From ac54e24fc4e8339c350cda3073ab4c03ee11d9e9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Sep 2021 15:12:06 +0530 Subject: [PATCH 06/37] refactor: convert doctype db.sql calls --- frappe/core/doctype/doctype/doctype.py | 38 ++++++++++++++------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index 8f8a8ed287..5a91016e32 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -23,6 +23,7 @@ from frappe.modules.import_file import get_file_path from frappe.model.meta import Meta from frappe.desk.utils import validate_route_conflict from frappe.website.utils import clear_cache +from frappe.query_builder.functions import Concat class InvalidFieldNameError(frappe.ValidationError): pass class UniqueFieldnameError(frappe.ValidationError): pass @@ -465,7 +466,7 @@ class DocType(Document): return # check if atleast 1 record exists - if not (frappe.db.table_exists(self.name) and frappe.db.sql("select name from `tab{}` limit 1".format(self.name))): + if not (frappe.db.table_exists(self.name) and frappe.get_all(self.name, fields=["name"], limit=1, as_list=True)): return existing_property_setter = frappe.db.get_value("Property Setter", {"doc_type": self.name, @@ -571,17 +572,17 @@ class DocType(Document): def make_amendable(self): """If is_submittable is set, add amended_from docfields.""" if self.is_submittable: - if not frappe.db.sql("""select name from tabDocField - where fieldname = 'amended_from' and parent = %s""", self.name): - self.append("fields", { - "label": "Amended From", - "fieldtype": "Link", - "fieldname": "amended_from", - "options": self.name, - "read_only": 1, - "print_hide": 1, - "no_copy": 1 - }) + docfield_exists = frappe.get_all("DocField", filters={"fieldname": "amended_from", "parent": self.name}, pluck="name", limit=1) + if not docfield_exists: + self.append("fields", { + "label": "Amended From", + "fieldtype": "Link", + "fieldname": "amended_from", + "options": self.name, + "read_only": 1, + "print_hide": 1, + "no_copy": 1 + }) def make_repeatable(self): """If allow_auto_repeat is set, add auto_repeat custom field.""" @@ -706,12 +707,13 @@ def validate_series(dt, autoname=None, name=None): and (not autoname.startswith('format:')): prefix = autoname.split('.')[0] - used_in = frappe.db.sql(""" - SELECT `name` - FROM `tabDocType` - WHERE `autoname` LIKE CONCAT(%s, '.%%') - AND `name`!=%s - """, (prefix, name)) + doctype = frappe.qb.DocType("DocType") + used_in = (frappe.qb + .from_(doctype) + .select(doctype.name) + .where(doctype.autoname.like(Concat(prefix,".%"))) + .where(doctype.name != name) + ).run() if used_in: frappe.throw(_("Series {0} already used in {1}").format(prefix, used_in[0][0])) From ab976aaaae255e3606c0eebde8e217846acb265b Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Sep 2021 15:13:10 +0530 Subject: [PATCH 07/37] refactor: convert test_file db.sql calls --- frappe/core/doctype/file/test_file.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frappe/core/doctype/file/test_file.py b/frappe/core/doctype/file/test_file.py index 4538ffb6bb..9a758b53f5 100644 --- a/frappe/core/doctype/file/test_file.py +++ b/frappe/core/doctype/file/test_file.py @@ -204,10 +204,14 @@ class TestFile(unittest.TestCase): def delete_test_data(self): - for f in frappe.db.sql('''select name, file_name from tabFile where - is_home_folder = 0 and is_attachments_folder = 0 order by creation desc'''): - frappe.delete_doc("File", f[0]) - + test_file_data = frappe.db.get_all( + "File", + pluck="name", + filters={"is_home_folder": 0, "is_attachments_folder": 0}, + order_by="creation desc", + ) + for f in test_file_data: + frappe.delete_doc("File", f) def upload_file(self): _file = frappe.get_doc({ From b0421ab7cca69862bcacf7922cd1d37276dfdbe3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Sep 2021 15:16:46 +0530 Subject: [PATCH 08/37] refactor: convert doctype log settings db.sql calls --- frappe/core/doctype/log_settings/log_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/log_settings/log_settings.py b/frappe/core/doctype/log_settings/log_settings.py index 8a471b9173..c505302c52 100644 --- a/frappe/core/doctype/log_settings/log_settings.py +++ b/frappe/core/doctype/log_settings/log_settings.py @@ -38,7 +38,7 @@ def has_unseen_error_log(user): 'message': _("You have unseen {0}").format(' Error Logs ') } - if frappe.db.sql_list("select name from `tabError Log` where seen = 0 limit 1"): + if frappe.get_all("Error Log", filters={"seen": 0}, limit=1): log_settings = frappe.get_cached_doc('Log Settings') if log_settings.users_to_notify: From 3cc2202ce9bd82cc04d04b839c8e85b76bf4a7f2 Mon Sep 17 00:00:00 2001 From: abhishek Date: Wed, 13 Oct 2021 11:59:01 +0530 Subject: [PATCH 09/37] refactor: convert doctype transaction_log db.sql calls --- frappe/core/doctype/transaction_log/transaction_log.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/transaction_log/transaction_log.py b/frappe/core/doctype/transaction_log/transaction_log.py index bb94642f48..e2e75b130c 100644 --- a/frappe/core/doctype/transaction_log/transaction_log.py +++ b/frappe/core/doctype/transaction_log/transaction_log.py @@ -14,10 +14,9 @@ class TransactionLog(Document): self.row_index = index self.timestamp = now_datetime() if index != 1: - prev_hash = frappe.db.sql( - "SELECT `chaining_hash` FROM `tabTransaction Log` WHERE `row_index` = '{0}'".format(index - 1)) + prev_hash = frappe.get_all("Transaction Log", filters={"row_index":str(index-1)}, pluck="chaining_hash", limit=1) if prev_hash: - self.previous_hash = prev_hash[0][0] + self.previous_hash = prev_hash[0] else: self.previous_hash = "Indexing broken" else: From d257adc1302b720016cc3ed830ede379aee4403e Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 16 Oct 2021 16:48:33 +0530 Subject: [PATCH 10/37] fix: Rename loader functions --- .../js/frappe/views/reports/query_report.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 8a50a516af..4a3a953a01 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -555,7 +555,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { refresh() { this.toggle_message(true); this.toggle_report(false); - this.show_loading_indicator(); + this.show_loading_screen(); let filters = this.get_filter_values(true); // only one refresh at a time @@ -646,7 +646,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { this.show_footer_message(); frappe.hide_progress(); }).finally(() => { - this.hide_loading_indicator(); + this.hide_loading_screen(); }); } @@ -871,18 +871,20 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { } } - show_loading_indicator() { - this.$loading.find('div').html(`
+ show_loading_screen() { + const loading_state = `
Generic Empty State

${__('Loading')}...

-
`); +
`; + + this.$loading.find('div').html(loading_state); this.$report.hide(); this.$loading.show(); } - hide_loading_indicator() { + hide_loading_screen() { this.$loading.hide(); this.$report.show(); } @@ -1699,7 +1701,6 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { this.$chart = $('
').hide().appendTo(this.page.main); this.$loading = $(this.message_div('')).hide().appendTo(this.page.main); - this.$report = $('
').appendTo(this.page.main); this.$message = $(this.message_div('')).hide().appendTo(this.page.main); } From 4146cd3ccaa0547668204320bcb5b603db063216 Mon Sep 17 00:00:00 2001 From: Summayya Hashmani <58825865+sumaiya2908@users.noreply.github.com> Date: Mon, 18 Oct 2021 09:28:44 +0530 Subject: [PATCH 11/37] refactor: child table layout in the web-form --- frappe/public/scss/website/index.scss | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frappe/public/scss/website/index.scss b/frappe/public/scss/website/index.scss index c3da42ed34..e5e9fe95c6 100644 --- a/frappe/public/scss/website/index.scss +++ b/frappe/public/scss/website/index.scss @@ -192,8 +192,8 @@ h5.modal-title { } .hidden-xs { - @extend .d-none; - @extend .d-sm-block; + @extend .d-block; + @extend .d-sm-none; } .visible-xs { @@ -216,6 +216,10 @@ h5.modal-title { float: right; } +.pull-left { + float: left; +} + .image-with-blur { transition: filter 300ms ease-in-out; filter: blur(1.5rem); From f51b1cc73997fba7df1b356c4f82a877797d4868 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 18 Oct 2021 11:51:33 +0530 Subject: [PATCH 12/37] fix: Remove unnecessary missing_ok kwarg from unlink missing_ok added in PY38, this change breaks installs for PY37. ref: https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink --- frappe/installer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/installer.py b/frappe/installer.py index 1fe891c852..70dbbb61e8 100755 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -507,14 +507,14 @@ def convert_archive_content(sql_file_path): sql_file_path = Path(sql_file_path) os.rename(sql_file_path, old_sql_file_path) - sql_file_path.unlink(missing_ok=True) + sql_file_path.unlink() sql_file_path.touch() with open(old_sql_file_path) as r, open(sql_file_path, "a") as w: for line in r: w.write(line.replace("ROW_FORMAT=COMPRESSED", "ROW_FORMAT=DYNAMIC")) - old_sql_file_path.unlink(missing_ok=True) + old_sql_file_path.unlink() def extract_sql_gzip(sql_gz_path): From 30c39acabe43de97a7fbe4a72cc6d0bcb933473c Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 18 Oct 2021 12:07:42 +0530 Subject: [PATCH 13/37] fix: Don't unlink file blindly This made sense with the missing_ok. But now, a try-except seems unnecessary too. Also, possibly destructive. Best to stray away from these things. --- frappe/installer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/frappe/installer.py b/frappe/installer.py index 70dbbb61e8..d1a13fdaab 100755 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -507,7 +507,6 @@ def convert_archive_content(sql_file_path): sql_file_path = Path(sql_file_path) os.rename(sql_file_path, old_sql_file_path) - sql_file_path.unlink() sql_file_path.touch() with open(old_sql_file_path) as r, open(sql_file_path, "a") as w: From 5c5c17687284006e7a12dee69cd810e9f8be5fbc Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 18 Oct 2021 12:20:06 +0530 Subject: [PATCH 14/37] fix: Check if parent exist in col before getting doc This fixes following error while downloading auto email report ``` Traceback (most recent call last): File "/Users/sps/benches/develop/apps/frappe/frappe/app.py", line 66, in application response = frappe.api.handle() File "/Users/sps/benches/develop/apps/frappe/frappe/api.py", line 54, in handle return frappe.handler.handle() File "/Users/sps/benches/develop/apps/frappe/frappe/handler.py", line 31, in handle data = execute_cmd(cmd) File "/Users/sps/benches/develop/apps/frappe/frappe/handler.py", line 67, in execute_cmd return frappe.call(method, **frappe.form_dict) File "/Users/sps/benches/develop/apps/frappe/frappe/__init__.py", line 1205, in call return fn(*args, **newargs) File "/Users/sps/benches/develop/apps/frappe/frappe/email/doctype/auto_email_report/auto_email_report.py", line 196, in download data = auto_email_report.get_report_content() File "/Users/sps/benches/develop/apps/frappe/frappe/email/doctype/auto_email_report/auto_email_report.py", line 98, in get_report_content columns, data = make_links(columns, data) File "/Users/sps/benches/develop/apps/frappe/frappe/email/doctype/auto_email_report/auto_email_report.py", line 253, in make_links doc = frappe.get_doc(col.parent, doc_name) if doc_name else None File "/Users/sps/benches/develop/apps/frappe/frappe/__init__.py", line 883, in get_doc doc = frappe.model.document.get_doc(*args, **kwargs) File "/Users/sps/benches/develop/apps/frappe/frappe/model/document.py", line 62, in get_doc raise ValueError('First non keyword argument must be a string or dict') ValueError: First non keyword argument must be a string or dict ``` The issue was introduced via https://github.com/frappe/frappe/pull/13340 --- frappe/email/doctype/auto_email_report/auto_email_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 37089d58df..7081a84e7a 100644 --- a/frappe/email/doctype/auto_email_report/auto_email_report.py +++ b/frappe/email/doctype/auto_email_report/auto_email_report.py @@ -249,7 +249,7 @@ def make_links(columns, data): if col.options and row.get(col.fieldname) and row.get(col.options): row[col.fieldname] = get_link_to_form(row[col.options], row[col.fieldname]) elif col.fieldtype == "Currency" and row.get(col.fieldname): - doc = frappe.get_doc(col.parent, doc_name) if doc_name else None + doc = frappe.get_doc(col.parent, doc_name) if doc_name and col.parent else None # Pass the Document to get the currency based on docfield option row[col.fieldname] = frappe.format_value(row[col.fieldname], col, doc=doc) return columns, data From 20d7a9df78bb227a8f938558b52235162923ce4e Mon Sep 17 00:00:00 2001 From: Summayya Hashmani <58825865+sumaiya2908@users.noreply.github.com> Date: Mon, 18 Oct 2021 13:32:35 +0530 Subject: [PATCH 15/37] feat: Add confirm password field (#14281) * fix: remove commented code * refactor: add confirm password field * fix: remove dialog and add inline warning * fix: capitalize words and text function * fix: capitalize words * style: Fix formatting * refactor:update class name Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> * refactor: remove indicator class and add margin Co-authored-by: Summayya Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> --- frappe/www/update-password.html | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/frappe/www/update-password.html b/frappe/www/update-password.html index 0d66fe5ab5..cacbce35b3 100644 --- a/frappe/www/update-password.html +++ b/frappe/www/update-password.html @@ -10,7 +10,7 @@

{{ _("Reset Password") if frappe.db.get_default('company') else _("Set Password")}}

- +
+ + + +
@@ -38,7 +44,7 @@