From 16e96b14f863dc3db7b0b3100c72cb585f18a137 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 20 Apr 2020 12:43:01 +0530 Subject: [PATCH 1/9] fix: message on reset password --- frappe/www/update-password.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/www/update-password.html b/frappe/www/update-password.html index f0ee0688d4..34e5ea137d 100644 --- a/frappe/www/update-password.html +++ b/frappe/www/update-password.html @@ -57,11 +57,11 @@ frappe.ready(function() { } if(!args.old_password && !args.key) { - frappe.msgprint("{{ _("Old Password Required.") }}"); + frappe.msgprint("{{ _('Old Password Required.') }}"); return; } if(!args.new_password) { - frappe.msgprint("{{ _("New Password Required.") }}"); + frappe.msgprint("{{ _('New Password Required.') }}"); return; } frappe.call({ @@ -79,11 +79,11 @@ frappe.ready(function() { strength_indicator.addClass('hidden'); strength_message.addClass('hidden'); $('.page-card-head .indicator') - .removeClass().addClass('indicator green') - .html("{{ _('Password Updated') }}"); + .removeClass().addClass('indicator blue') + .html("{{ _('Status Updated') }}"); if(r.message) { frappe.msgprint({ - message: "{{ _("Password Updated") }}", + message: `{{ _('${r.message}') }}`, // password is updated successfully // clear any server message clear: true From 27b5819e3466ad254edb7262800a8589efb9d231 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Wed, 22 Apr 2020 11:55:46 +0530 Subject: [PATCH 2/9] fix: skip validation if oldfieldtype is not set to data Signed-off-by: Chinmay D. Pai --- frappe/model/base_document.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index ca6261076e..36f6970995 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -565,10 +565,14 @@ class BaseDocument(object): for data_field in self.meta.get_data_fields(): data = self.get(data_field.fieldname) data_field_options = data_field.get("options") + old_fieldtype = data_field.get("oldfieldtype") + + if old_fieldtype and old_fieldtype != "Data": + continue if data_field_options == "Email": if (self.owner in STANDARD_USERS) and (data in STANDARD_USERS): - return + continue for email_address in frappe.utils.split_emails(data): frappe.utils.validate_email_address(email_address, throw=True) From 919562e60e8e63cebdaca3e8ea951a83029a2f4f Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Wed, 22 Apr 2020 12:22:46 +0530 Subject: [PATCH 3/9] fix: skip data validation on creation if oldfieldtype is set Signed-off-by: Chinmay D. Pai --- frappe/core/doctype/doctype/doctype.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index f7c9cbe28a..7306f90108 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -893,7 +893,7 @@ def validate_fields(meta): field.fetch_from = field.fetch_from.strip('\n').strip() def validate_data_field_type(docfield): - if docfield.fieldtype == "Data": + if docfield.fieldtype == "Data" and not (docfield.oldfieldtype and docfield.oldfieldtype != "Data"): if docfield.options and (docfield.options not in data_field_options): df_str = frappe.bold(_(docfield.label)) text_str = _("{0} is an invalid Data field.").format(df_str) + "
" * 2 + _("Only Options allowed for Data field are:") + "
" From a3059b10d1518f2e858ec1b82047ef2895aed463 Mon Sep 17 00:00:00 2001 From: prssanna Date: Wed, 22 Apr 2020 12:32:44 +0530 Subject: [PATCH 4/9] fix: move expand button after description and change label according to state --- frappe/public/js/frappe/form/controls/code.js | 11 ++++++++--- frappe/public/less/form.less | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frappe/public/js/frappe/form/controls/code.js b/frappe/public/js/frappe/form/controls/code.js index bdf36b706a..446b9b5fd8 100644 --- a/frappe/public/js/frappe/form/controls/code.js +++ b/frappe/public/js/frappe/form/controls/code.js @@ -10,11 +10,11 @@ frappe.ui.form.ControlCode = frappe.ui.form.ControlText.extend({ .appendTo(this.input_area); this.expanded = false; - this.$expand_button = $(``).click(() => { + this.$expand_button = $(``).click(() => { this.expanded = !this.expanded; this.refresh_height(); - }).insertAfter(this.ace_editor_target); - + this.toggle_label(); + }).appendTo(this.$input_wrapper); // styling this.ace_editor_target.addClass('border rounded'); this.ace_editor_target.css('height', 300); @@ -37,6 +37,11 @@ frappe.ui.form.ControlCode = frappe.ui.form.ControlText.extend({ this.editor.resize(); }, + toggle_label() { + const button_label = this.expanded? __('Collapse'): __('Expand'); + this.$expand_button.text(button_label); + }, + set_language() { const language_map = { 'Javascript': 'ace/mode/javascript', diff --git a/frappe/public/less/form.less b/frappe/public/less/form.less index b72d249aab..8e43b05122 100644 --- a/frappe/public/less/form.less +++ b/frappe/public/less/form.less @@ -770,6 +770,7 @@ h6.uppercase, .h6.uppercase { .help-box { margin-top: 3px; + margin-bottom: 6px; } pre { From c3519b5a124d88d72f81b369d779015f2a311494 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Fri, 24 Apr 2020 10:31:08 +0530 Subject: [PATCH 5/9] fix: Do not check for module for custom doctypes (#10081) --- frappe/desk/notifications.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frappe/desk/notifications.py b/frappe/desk/notifications.py index 3a8815ca71..109dd25f4f 100644 --- a/frappe/desk/notifications.py +++ b/frappe/desk/notifications.py @@ -268,8 +268,9 @@ def get_open_count(doctype, name, items=[]): "count": out, } - module = frappe.get_meta_module(doctype) - if hasattr(module, "get_timeline_data"): - out["timeline_data"] = module.get_timeline_data(doctype, name) + if not meta.custom: + module = frappe.get_meta_module(doctype) + if hasattr(module, "get_timeline_data"): + out["timeline_data"] = module.get_timeline_data(doctype, name) return out From d678fc62abf8c5b8495a1ac3e97655ef704b6022 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Fri, 24 Apr 2020 11:25:36 +0530 Subject: [PATCH 6/9] fix: Clear `__unsaved` flag after document save (#10082) --- frappe/model/document.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/model/document.py b/frappe/model/document.py index f2495e9e20..5e01f5e65f 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -329,6 +329,10 @@ class Document(BaseDocument): self.update_children() self.run_post_save_methods() + # clear unsaved flag + if hasattr(self, "__unsaved"): + delattr(self, "__unsaved") + return self def copy_attachments_from_amended_from(self): From a3b9761f76b7e816e20051268cdff0a563e0706f Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Fri, 24 Apr 2020 13:43:35 +0530 Subject: [PATCH 7/9] style: Fix formatting --- frappe/public/js/frappe/form/controls/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/controls/code.js b/frappe/public/js/frappe/form/controls/code.js index 446b9b5fd8..6b40201001 100644 --- a/frappe/public/js/frappe/form/controls/code.js +++ b/frappe/public/js/frappe/form/controls/code.js @@ -38,7 +38,7 @@ frappe.ui.form.ControlCode = frappe.ui.form.ControlText.extend({ }, toggle_label() { - const button_label = this.expanded? __('Collapse'): __('Expand'); + const button_label = this.expanded ? __('Collapse') : __('Expand'); this.$expand_button.text(button_label); }, From e0d9cf50df83a0fe265aedea7920ca0a29f673f8 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 24 Apr 2020 18:32:03 +0530 Subject: [PATCH 8/9] fix: update password API mapping for /update-password --- frappe/www/update-password.html | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/frappe/www/update-password.html b/frappe/www/update-password.html index 34e5ea137d..d12be86d12 100644 --- a/frappe/www/update-password.html +++ b/frappe/www/update-password.html @@ -9,7 +9,7 @@ {{ _("Reset Password") if frappe.db.get_default('company') else _("Set Password")}}
-
+ @@ -32,8 +32,8 @@