From 2fb27a7ceb9f2aa575832b68c8562d84b3939b37 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 15 May 2020 13:23:53 +0530 Subject: [PATCH 01/27] refactor: explicitly hide amend button in toolbar --- frappe/public/js/frappe/form/toolbar.js | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/frappe/public/js/frappe/form/toolbar.js b/frappe/public/js/frappe/form/toolbar.js index 528c874935..6f475fa9e5 100644 --- a/frappe/public/js/frappe/form/toolbar.js +++ b/frappe/public/js/frappe/form/toolbar.js @@ -374,19 +374,24 @@ frappe.ui.form.Toolbar = Class.extend({ var status = this.get_action_status(); if (status) { - if (status !== this.current_status) { - if (status === 'Amend') { - let doc = this.frm.doc; - frappe.xcall('frappe.client.is_document_amended', { - 'doctype': doc.doctype, - 'docname': doc.name - }).then(is_amended => { - if (is_amended) return; - this.set_page_actions(status); - }); - } else { + // When moving from a page with status amend to another page with status amend + // We need to check if document is already amened specifcally and hide + // or clear the menu actions accordingly + + if (status !== this.current_status || status === 'Amend') { + let doc = this.frm.doc; + frappe.xcall('frappe.client.is_document_amended', { + 'doctype': doc.doctype, + 'docname': doc.name + }).then(is_amended => { + if (is_amended) { + this.page.clear_actions(); + return; + } this.set_page_actions(status); - } + }); + } else { + this.set_page_actions(status); } } else { this.page.clear_actions(); From bfaf2fcf7740de19c8568235e80c5eb3ac3cfbf4 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 15 May 2020 13:24:06 +0530 Subject: [PATCH 02/27] feat: do not allow amending already amended docs --- frappe/public/js/frappe/form/form.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js index 01dfbf81f9..58a1be73c1 100644 --- a/frappe/public/js/frappe/form/form.js +++ b/frappe/public/js/frappe/form/form.js @@ -780,15 +780,24 @@ frappe.ui.form.Form = class FrappeForm { frappe.msgprint(__('"amended_from" field must be present to do an amendment.')); return; } - this.validate_form_action("Amend"); - var me = this; - var fn = function(newdoc) { - newdoc.amended_from = me.docname; - if(me.fields_dict && me.fields_dict['amendment_date']) - newdoc.amendment_date = frappe.datetime.obj_to_str(new Date()); - }; - this.copy_doc(fn, 1); - frappe.utils.play_sound("click"); + + frappe.xcall('frappe.client.is_document_amended', { + 'doctype': this.doc.doctype, + 'docname': this.doc.name + }).then(is_amended => { + if (is_amended) { + frappe.throw(__('This document is already amended, you cannot ammend it again')) + }; + this.validate_form_action("Amend"); + var me = this; + var fn = function(newdoc) { + newdoc.amended_from = me.docname; + if(me.fields_dict && me.fields_dict['amendment_date']) + newdoc.amendment_date = frappe.datetime.obj_to_str(new Date()); + }; + this.copy_doc(fn, 1); + frappe.utils.play_sound("click"); + }); } validate_form_action(action, resolve) { From e4729b00008449e0f96136fe4bfd1f80280b01e7 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Sat, 16 May 2020 13:29:44 +0530 Subject: [PATCH 03/27] feat: added FileAlreadyAttachedException --- frappe/exceptions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/exceptions.py b/frappe/exceptions.py index 5a1181f31e..fe8c1895d7 100644 --- a/frappe/exceptions.py +++ b/frappe/exceptions.py @@ -98,6 +98,7 @@ class InvalidColumnName(ValidationError): pass class IncompatibleApp(ValidationError): pass class InvalidDates(ValidationError): pass class DataTooLongException(ValidationError): pass +class FileAlreadyAttachedException(Exception): pass # OAuth exceptions class InvalidAuthorizationHeader(CSRFTokenError): pass class InvalidAuthorizationPrefix(CSRFTokenError): pass From d837535740456cff5e1f65bdbad7e67936e99f47 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Sat, 16 May 2020 13:30:15 +0530 Subject: [PATCH 04/27] fix: raise explicit exception not conflicting with NameError --- frappe/core/doctype/file/file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/file/file.py b/frappe/core/doctype/file/file.py index b35abfa861..fedd35aa4f 100755 --- a/frappe/core/doctype/file/file.py +++ b/frappe/core/doctype/file/file.py @@ -180,11 +180,11 @@ class File(Document): if duplicate_file: duplicate_file_doc = frappe.get_cached_doc('File', duplicate_file.name) if duplicate_file_doc.exists_on_disk(): - # if it is attached to a document then throw DuplicateEntryError + # if it is attached to a document then throw FileAlreadyAttachedException if self.attached_to_doctype and self.attached_to_name: self.duplicate_entry = duplicate_file.name frappe.throw(_("Same file has already been attached to the record"), - frappe.DuplicateEntryError) + frappe.FileAlreadyAttachedException) # else just use the url, to avoid uploading a duplicate else: self.file_url = duplicate_file.file_url From af0cccf5cd518e257386ec87808c5e9ef4deeaed Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Sat, 16 May 2020 13:52:30 +0530 Subject: [PATCH 05/27] refactor: delete doc directly without checking for comments --- frappe/core/doctype/file/file.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/file/file.py b/frappe/core/doctype/file/file.py index fedd35aa4f..0f57ed0a5e 100755 --- a/frappe/core/doctype/file/file.py +++ b/frappe/core/doctype/file/file.py @@ -704,7 +704,12 @@ def remove_all(dt, dn, from_delete=False): try: for fid in frappe.db.sql_list("""select name from `tabFile` where attached_to_doctype=%s and attached_to_name=%s""", (dt, dn)): - remove_file(fid=fid, attached_to_doctype=dt, attached_to_name=dn, from_delete=from_delete) + if from_delete: + # If deleting a doc, directly delete files + frappe.delete_doc("File", fid, ignore_permissions=True) + else: + # Removes file and adds a comment in the document it is attached to + remove_file(fid=fid, attached_to_doctype=dt, attached_to_name=dn, from_delete=from_delete) except Exception as e: if e.args[0]!=1054: raise # (temp till for patched) From aef2da89b9a91e15df9499ea9908ff4e3464641e Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Sat, 16 May 2020 13:59:16 +0530 Subject: [PATCH 06/27] style: linting fixes for sider --- frappe/public/js/frappe/form/form.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js index 58a1be73c1..8a498a69a2 100644 --- a/frappe/public/js/frappe/form/form.js +++ b/frappe/public/js/frappe/form/form.js @@ -786,13 +786,13 @@ frappe.ui.form.Form = class FrappeForm { 'docname': this.doc.name }).then(is_amended => { if (is_amended) { - frappe.throw(__('This document is already amended, you cannot ammend it again')) - }; + frappe.throw(__('This document is already amended, you cannot ammend it again')); + } this.validate_form_action("Amend"); var me = this; var fn = function(newdoc) { newdoc.amended_from = me.docname; - if(me.fields_dict && me.fields_dict['amendment_date']) + if (me.fields_dict && me.fields_dict['amendment_date']) newdoc.amendment_date = frappe.datetime.obj_to_str(new Date()); }; this.copy_doc(fn, 1); From 77062721ed78f2000615e072d95b247b1d94ec47 Mon Sep 17 00:00:00 2001 From: Rohan Bansal Date: Sat, 30 May 2020 19:00:11 +0530 Subject: [PATCH 07/27] feat: allow mapper functions to be overriden --- frappe/model/mapper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frappe/model/mapper.py b/frappe/model/mapper.py index 3639a947c0..d3014435e0 100644 --- a/frappe/model/mapper.py +++ b/frappe/model/mapper.py @@ -14,6 +14,12 @@ def make_mapped_doc(method, source_name, selected_children=None, args=None): Sets selected_children as flags for the `get_mapped_doc` method. Called from `open_mapped_doc` from create_new.js''' + + for hook in frappe.get_hooks("override_whitelisted_methods", {}).get(method, []): + # override using the first hook + method = hook + break + method = frappe.get_attr(method) if method not in frappe.whitelisted: From 7e1d158636ab9d86a8ee4616126fbcb42c667da6 Mon Sep 17 00:00:00 2001 From: Fumin Date: Tue, 2 Jun 2020 21:00:07 +0800 Subject: [PATCH 08/27] show label for table fields All fields, except table ones, display their labels which is a natural thing to do. --- frappe/templates/print_formats/standard_macros.html | 1 + 1 file changed, 1 insertion(+) diff --git a/frappe/templates/print_formats/standard_macros.html b/frappe/templates/print_formats/standard_macros.html index f879dd7e08..d684c60a2d 100644 --- a/frappe/templates/print_formats/standard_macros.html +++ b/frappe/templates/print_formats/standard_macros.html @@ -34,6 +34,7 @@ {%- if data -%} {%- set visible_columns = get_visible_columns(doc.get(df.fieldname), table_meta, df) -%} +
From 3a0aa88f4b6d45054806819bdfdc2d5a3b6b6ef4 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 2 Jun 2020 22:06:37 +0530 Subject: [PATCH 09/27] fix: change 'show' duration options to 'hide' for consistency --- cypress/integration/control_duration.js | 8 +++--- frappe/core/doctype/docfield/docfield.json | 22 ++++++++-------- .../doctype/custom_field/custom_field.json | 26 ++++++++----------- .../customize_form_field.json | 26 ++++++++----------- .../js/frappe/form/controls/duration.js | 8 +++--- frappe/public/js/frappe/ui/filters/filters.js | 4 +-- frappe/public/js/frappe/utils/utils.js | 6 ++--- frappe/utils/data.py | 4 +-- frappe/utils/formatters.py | 4 +-- 9 files changed, 50 insertions(+), 58 deletions(-) diff --git a/cypress/integration/control_duration.js b/cypress/integration/control_duration.js index f304abd3d9..edad759216 100644 --- a/cypress/integration/control_duration.js +++ b/cypress/integration/control_duration.js @@ -4,14 +4,14 @@ context('Control Duration', () => { cy.visit('/desk#workspace/Website'); }); - function get_dialog_with_duration(show_days=1, show_seconds=1) { + function get_dialog_with_duration(hide_days=0, hide_seconds=0) { return cy.dialog({ title: 'Duration', fields: [{ 'fieldname': 'duration', 'fieldtype': 'Duration', - 'show_seconds': show_days, - 'show_days': show_seconds + 'hide_days': hide_days, + 'hide_seconds': hide_seconds }] }); } @@ -37,7 +37,7 @@ context('Control Duration', () => { }); it('should hide days or seconds according to duration options', () => { - get_dialog_with_duration(0, 0).as('dialog'); + get_dialog_with_duration(1, 1).as('dialog'); cy.get('.frappe-control[data-fieldname=duration] input').first().click(); cy.get('.duration-input[data-duration=days]').should('not.be.visible'); cy.get('.duration-input[data-duration=seconds]').should('not.be.visible'); diff --git a/frappe/core/doctype/docfield/docfield.json b/frappe/core/doctype/docfield/docfield.json index 83d3c18453..aab59a5a0a 100644 --- a/frappe/core/doctype/docfield/docfield.json +++ b/frappe/core/doctype/docfield/docfield.json @@ -13,8 +13,8 @@ "fieldname", "precision", "length", - "show_days", - "show_seconds", + "hide_days", + "hide_seconds", "reqd", "search_index", "in_list_view", @@ -453,18 +453,18 @@ "fieldtype": "Column Break" }, { - "default": "1", - "depends_on": "eval:doc.fieldtype === \"Duration\";", - "fieldname": "show_days", + "default": "0", + "depends_on": "eval:doc.fieldtype=='Duration'", + "fieldname": "hide_days", "fieldtype": "Check", - "label": "Show Days" + "label": "Hide Days" }, { - "default": "1", - "depends_on": "eval:doc.fieldtype === \"Duration\";", - "fieldname": "show_seconds", + "default": "0", + "depends_on": "eval:doc.fieldtype=='Duration'", + "fieldname": "hide_seconds", "fieldtype": "Check", - "label": "Show Seconds" + "label": "Hide Seconds" }, { "default": "0", @@ -477,7 +477,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2020-05-15 09:06:25.224411", + "modified": "2020-02-06 09:06:25.224413", "modified_by": "Administrator", "module": "Core", "name": "DocField", diff --git a/frappe/custom/doctype/custom_field/custom_field.json b/frappe/custom/doctype/custom_field/custom_field.json index 77490c8c43..6fa7b29161 100644 --- a/frappe/custom/doctype/custom_field/custom_field.json +++ b/frappe/custom/doctype/custom_field/custom_field.json @@ -16,8 +16,8 @@ "column_break_6", "fieldtype", "precision", - "show_seconds", - "show_days", + "hide_seconds", + "hide_days", "options", "fetch_from", "fetch_if_empty", @@ -383,22 +383,18 @@ "label": "In Preview" }, { - "default": "1", - "depends_on": "eval:doc.fieldtype === \"Duration\";", - "fieldname": "show_seconds", + "default": "0", + "depends_on": "eval:doc.fieldtype=='Duration'", + "fieldname": "hide_seconds", "fieldtype": "Check", - "label": "Show Seconds", - "show_days": 1, - "show_seconds": 1 + "label": "Hide Seconds" }, { - "default": "1", - "depends_on": "eval:doc.fieldtype === \"Duration\";", - "fieldname": "show_days", + "default": "0", + "depends_on": "eval:doc.fieldtype=='Duration'", + "fieldname": "hide_days", "fieldtype": "Check", - "label": "Show Days", - "show_days": 1, - "show_seconds": 1 + "label": "Hide Days" }, { "default": "0", @@ -411,7 +407,7 @@ "icon": "fa fa-glass", "idx": 1, "links": [], - "modified": "2020-05-15 23:43:00.123572", + "modified": "2020-02-06 23:43:00.123575", "modified_by": "Administrator", "module": "Custom", "name": "Custom Field", diff --git a/frappe/custom/doctype/customize_form_field/customize_form_field.json b/frappe/custom/doctype/customize_form_field/customize_form_field.json index f422c36e61..267213517c 100644 --- a/frappe/custom/doctype/customize_form_field/customize_form_field.json +++ b/frappe/custom/doctype/customize_form_field/customize_form_field.json @@ -11,8 +11,8 @@ "label", "fieldtype", "fieldname", - "show_seconds", - "show_days", + "hide_seconds", + "hide_days", "reqd", "unique", "in_list_view", @@ -393,22 +393,18 @@ "label": "In Preview" }, { - "default": "1", - "depends_on": "eval:doc.fieldtype === \"Duration\";", - "fieldname": "show_seconds", + "default": "0", + "depends_on": "eval:doc.fieldtype=='Duration'", + "fieldname": "hide_seconds", "fieldtype": "Check", - "label": "Show Seconds", - "show_days": 1, - "show_seconds": 1 + "label": "Hide Seconds" }, { - "default": "1", - "depends_on": "eval:doc.fieldtype === \"Duration\";", - "fieldname": "show_days", + "default": "0", + "depends_on": "eval:doc.fieldtype=='Duration'", + "fieldname": "hide_days", "fieldtype": "Check", - "label": "Show Days", - "show_days": 1, - "show_seconds": 1 + "label": "Hide Days" }, { "default": "0", @@ -421,7 +417,7 @@ "idx": 1, "istable": 1, "links": [], - "modified": "2020-05-15 23:45:46.810869", + "modified": "2020-06-02 23:45:46.810868", "modified_by": "Administrator", "module": "Custom", "name": "Customize Form Field", diff --git a/frappe/public/js/frappe/form/controls/duration.js b/frappe/public/js/frappe/form/controls/duration.js index 58df8e15e6..e70afd6e65 100644 --- a/frappe/public/js/frappe/form/controls/duration.js +++ b/frappe/public/js/frappe/form/controls/duration.js @@ -13,10 +13,10 @@ frappe.ui.form.ControlDuration = frappe.ui.form.ControlData.extend({ ` ); this.$wrapper.append(this.$picker); - this.build_numeric_input("days", !this.duration_options.show_days); + this.build_numeric_input("days", this.duration_options.hide_days); this.build_numeric_input("hours", false); this.build_numeric_input("minutes", false); - this.build_numeric_input("seconds", !this.duration_options.show_seconds); + this.build_numeric_input("seconds", this.duration_options.hide_seconds); this.set_duration_picker_value(this.value); this.$picker.hide(); this.bind_events(); @@ -130,10 +130,10 @@ frappe.ui.form.ControlDuration = frappe.ui.form.ControlData.extend({ if (this.inputs) { total_duration.minutes = parseInt(this.inputs.minutes.val()); total_duration.hours = parseInt(this.inputs.hours.val()); - if (this.duration_options.show_days) { + if (!this.duration_options.hide_days) { total_duration.days = parseInt(this.inputs.days.val()); } - if (this.duration_options.show_seconds) { + if (!this.duration_options.hide_seconds) { total_duration.seconds = parseInt(this.inputs.seconds.val()); } } diff --git a/frappe/public/js/frappe/ui/filters/filters.js b/frappe/public/js/frappe/ui/filters/filters.js index f8f0535b83..a775413d39 100644 --- a/frappe/public/js/frappe/ui/filters/filters.js +++ b/frappe/public/js/frappe/ui/filters/filters.js @@ -202,8 +202,8 @@ frappe.ui.FilterList = Class.extend({ value = {0:"No", 1:"Yes"}[cint(value)]; } else if (field.df.original_type === "Duration") { let duration_options = { - show_days: field.df.show_days, - show_seconds: field.df.show_seconds + hide_days: field.df.hide_days, + hide_seconds: field.df.hide_seconds }; value = frappe.utils.get_formatted_duration(value, duration_options); } diff --git a/frappe/public/js/frappe/utils/utils.js b/frappe/public/js/frappe/utils/utils.js index f4dde5804f..38c22c9c9f 100644 --- a/frappe/public/js/frappe/utils/utils.js +++ b/frappe/public/js/frappe/utils/utils.js @@ -856,7 +856,7 @@ Object.assign(frappe.utils, { minutes: Math.floor(secs % 3600 / 60), seconds: Math.floor(secs % 60) }; - if (!duration_options.show_days) { + if (duration_options.hide_days) { total_duration.hours = Math.floor(secs / 3600); total_duration.days = 0; } @@ -882,8 +882,8 @@ Object.assign(frappe.utils, { get_duration_options: function(docfield) { let duration_options = { - show_days: docfield.show_days, - show_seconds: docfield.show_seconds + hide_days: docfield.hide_days, + hide_seconds: docfield.hide_seconds }; return duration_options; } diff --git a/frappe/utils/data.py b/frappe/utils/data.py index 1a4604ffff..a046aca144 100644 --- a/frappe/utils/data.py +++ b/frappe/utils/data.py @@ -336,7 +336,7 @@ def format_datetime(datetime_string, format_string=None): formatted_datetime = datetime.strftime('%Y-%m-%d %H:%M:%S') return formatted_datetime -def format_duration(seconds, show_days=True): +def format_duration(seconds, hide_days=False): total_duration = { 'days': math.floor(seconds / (3600 * 24)), 'hours': math.floor(seconds % (3600 * 24) / 3600), @@ -344,7 +344,7 @@ def format_duration(seconds, show_days=True): 'seconds': math.floor(seconds % 60) } - if not show_days: + if hide_days: total_duration['hours'] = math.floor(seconds / 3600) total_duration['days'] = 0 diff --git a/frappe/utils/formatters.py b/frappe/utils/formatters.py index d7646eeb71..d68102ae9e 100644 --- a/frappe/utils/formatters.py +++ b/frappe/utils/formatters.py @@ -91,7 +91,7 @@ def format_value(value, df=None, doc=None, currency=None, translated=False): return ', '.join(values) elif df.get("fieldtype") == "Duration": - show_days = df.show_days - return format_duration(value, show_days) + hide_days = df.hide_days + return format_duration(value, hide_days) return value From a0054f99b2efc0f17577aa7ef7d0fe3d8cba7c11 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 2 Jun 2020 22:12:24 +0530 Subject: [PATCH 10/27] fix: add duration options to sql files --- frappe/custom/doctype/customize_form/customize_form.py | 4 +++- frappe/database/mariadb/framework_mariadb.sql | 2 ++ frappe/database/postgres/framework_postgres.sql | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frappe/custom/doctype/customize_form/customize_form.py b/frappe/custom/doctype/customize_form/customize_form.py index 6a54d9c7e6..d4eeba3f93 100644 --- a/frappe/custom/doctype/customize_form/customize_form.py +++ b/frappe/custom/doctype/customize_form/customize_form.py @@ -77,7 +77,9 @@ docfield_properties = { 'allow_bulk_edit': 'Check', 'auto_repeat': 'Link', 'allow_in_quick_entry': 'Check', - 'hide_border': 'Check' + 'hide_border': 'Check', + 'hide_days': 'Check', + 'hide_seconds': 'Check' } allowed_fieldtype_change = (('Currency', 'Float', 'Percent'), ('Small Text', 'Data'), diff --git a/frappe/database/mariadb/framework_mariadb.sql b/frappe/database/mariadb/framework_mariadb.sql index bd93069a3f..af537e0612 100644 --- a/frappe/database/mariadb/framework_mariadb.sql +++ b/frappe/database/mariadb/framework_mariadb.sql @@ -64,6 +64,8 @@ CREATE TABLE `tabDocField` ( `length` int(11) NOT NULL DEFAULT 0, `translatable` int(1) NOT NULL DEFAULT 0, `hide_border` int(1) NOT NULL DEFAULT 0, + `hide_days` int(1) NOT NULL DEFAULT 0, + `hide_seconds` int(1) NOT NULL DEFAULT 0, PRIMARY KEY (`name`), KEY `parent` (`parent`), KEY `label` (`label`), diff --git a/frappe/database/postgres/framework_postgres.sql b/frappe/database/postgres/framework_postgres.sql index 76309e7347..8f77ed6230 100644 --- a/frappe/database/postgres/framework_postgres.sql +++ b/frappe/database/postgres/framework_postgres.sql @@ -64,6 +64,8 @@ CREATE TABLE "tabDocField" ( "length" bigint NOT NULL DEFAULT 0, "translatable" smallint NOT NULL DEFAULT 0, "hide_border" smallint NOT NULL DEFAULT 0, + "hide_days" smallint NOT NULL DEFAULT 0, + "hide_seconds" smallint NOT NULL DEFAULT 0, PRIMARY KEY ("name") ) ; From f4a8a5331b6f05c626b2196143bb0fc6aa213eb3 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Wed, 3 Jun 2020 19:26:55 +0530 Subject: [PATCH 11/27] fix: patch for removing old duration options --- frappe/patches.txt | 1 + frappe/patches/v13_0/remove_duration_options.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 frappe/patches/v13_0/remove_duration_options.py diff --git a/frappe/patches.txt b/frappe/patches.txt index fb5bf447b7..427b5f29cf 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -288,3 +288,4 @@ execute:frappe.delete_doc("DocType", "Onboarding Slide") execute:frappe.delete_doc("DocType", "Onboarding Slide Field") execute:frappe.delete_doc("DocType", "Onboarding Slide Help Link") frappe.patches.v13_0.update_date_filters_in_user_settings +frappe.patches.v13_0.remove_duration_options diff --git a/frappe/patches/v13_0/remove_duration_options.py b/frappe/patches/v13_0/remove_duration_options.py new file mode 100644 index 0000000000..65d14c6725 --- /dev/null +++ b/frappe/patches/v13_0/remove_duration_options.py @@ -0,0 +1,14 @@ +# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors +# MIT License. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + if frappe.db.has_column('DocField', 'show_days'): + frappe.db.sql('alter table tabDocField drop column show_days') + + if frappe.db.has_column('DocField', 'show_seconds'): + frappe.db.sql('alter table tabDocField drop column show_seconds') + + frappe.clear_cache(doctype='DocField') \ No newline at end of file From d899b1a9a2bb8b20c2a9e5b75bb275ccbc685e8f Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Fri, 5 Jun 2020 13:33:08 +0530 Subject: [PATCH 12/27] feat(Communication): set avg response time in parent --- .../doctype/communication/communication.py | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 20e4774add..e2dab3b7fc 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -448,13 +448,16 @@ def update_parent_document_on_communication(doc): # if status has a "Replied" option, then update the status for received communication if ('Replied' in options) and doc.sent_or_received=="Received": - parent.db_set("status", "Open") + parent.status = "Open" + parent.flags.ignore_mandatory = True + parent.save() apply_assignment_rule(parent) else: # update the modified date for document parent.update_modified() update_mins_to_first_communication(parent, doc) + set_avg_response_time(parent, doc) parent.run_method('notify_communication', doc) parent.notify_update() @@ -465,3 +468,25 @@ def update_mins_to_first_communication(parent, communication): if parent.meta.has_field('first_responded_on') and communication.sent_or_received == "Sent": parent.db_set('first_responded_on', first_responded_on) parent.db_set('mins_to_first_response', round(time_diff_in_seconds(first_responded_on, parent.creation) / 60), 2) + +def set_avg_response_time(parent, communication): + if parent.meta.has_field("avg_response_time") and communication.sent_or_received == "Sent": + # avg response time for all the responses + communications = frappe.get_list("Communication", filters={ + "reference_doctype": parent.doctype, + "reference_name": parent.name + }, + fields=["sent_or_received", "name", "creation"], + order_by="creation" + ) + + if len(communications): + response_times = [] + for i in range(len(communications)): + if communications[i].sent_or_received == "Sent" and communications[i-1].sent_or_received == "Received": + response_time = round(time_diff_in_seconds(communications[i].creation, communications[i-1].creation), 2) + if response_time > 0: + response_times.append(response_time) + if response_times: + avg_response_time = sum(response_times) / len(response_times) + parent.db_set("avg_response_time", avg_response_time) \ No newline at end of file From 23b037ab55119f0dd121f259673629329d286d4c Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 8 Jun 2020 12:33:49 +0530 Subject: [PATCH 13/27] fix: hidden chart show on refresh --- frappe/public/js/frappe/views/reports/report_view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/views/reports/report_view.js b/frappe/public/js/frappe/views/reports/report_view.js index bc4129935e..0791a0e6ad 100644 --- a/frappe/public/js/frappe/views/reports/report_view.js +++ b/frappe/public/js/frappe/views/reports/report_view.js @@ -186,7 +186,6 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView { if (this.group_by) { this.$charts_wrapper.addClass('hidden'); } else if (this.chart) { - this.$charts_wrapper.removeClass('hidden'); this.refresh_charts(); } @@ -518,7 +517,8 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView { } refresh_charts() { - if (!this.chart) return; + if (!this.chart || !this.chart_args) return; + this.$charts_wrapper.removeClass('hidden'); const { x_axis, y_axes, chart_type } = this.chart_args; this.build_chart_args(x_axis, y_axes, chart_type); this.chart.update(this.chart_args); From b3afc48932b9cac80591b19590213e3459c16328 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 8 Jun 2020 12:56:46 +0530 Subject: [PATCH 14/27] fix: don't send total row in checked items --- frappe/public/js/frappe/views/reports/report_view.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/views/reports/report_view.js b/frappe/public/js/frappe/views/reports/report_view.js index bc4129935e..a77cfa9880 100644 --- a/frappe/public/js/frappe/views/reports/report_view.js +++ b/frappe/public/js/frappe/views/reports/report_view.js @@ -1095,8 +1095,7 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView { get_checked_items(only_docnames) { const indexes = this.datatable.rowmanager.getCheckedRows(); - const items = indexes.filter(i => i != undefined) - .map(i => this.data[i]); + const items = indexes.map(i => this.data[i]).filter(i => i != undefined) if (only_docnames) { return items.map(d => d.name); From 06eaa61180f7b7d15bba07186345366773527e01 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 8 Jun 2020 13:09:51 +0530 Subject: [PATCH 15/27] style: add missing semi colon --- frappe/public/js/frappe/views/reports/report_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/views/reports/report_view.js b/frappe/public/js/frappe/views/reports/report_view.js index a77cfa9880..ee3c1574e5 100644 --- a/frappe/public/js/frappe/views/reports/report_view.js +++ b/frappe/public/js/frappe/views/reports/report_view.js @@ -1095,7 +1095,7 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView { get_checked_items(only_docnames) { const indexes = this.datatable.rowmanager.getCheckedRows(); - const items = indexes.map(i => this.data[i]).filter(i => i != undefined) + const items = indexes.map(i => this.data[i]).filter(i => i != undefined); if (only_docnames) { return items.map(d => d.name); From 8bf3c30d4da50b80f4846868780e8a13a7804756 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 8 Jun 2020 18:04:17 +0530 Subject: [PATCH 16/27] fix: set duration options in patch --- frappe/patches.txt | 2 +- .../patches/v13_0/remove_duration_options.py | 14 ---------- .../patches/v13_0/update_duration_options.py | 28 +++++++++++++++++++ 3 files changed, 29 insertions(+), 15 deletions(-) delete mode 100644 frappe/patches/v13_0/remove_duration_options.py create mode 100644 frappe/patches/v13_0/update_duration_options.py diff --git a/frappe/patches.txt b/frappe/patches.txt index 427b5f29cf..582b369343 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -288,4 +288,4 @@ execute:frappe.delete_doc("DocType", "Onboarding Slide") execute:frappe.delete_doc("DocType", "Onboarding Slide Field") execute:frappe.delete_doc("DocType", "Onboarding Slide Help Link") frappe.patches.v13_0.update_date_filters_in_user_settings -frappe.patches.v13_0.remove_duration_options +frappe.patches.v13_0.update_duration_options diff --git a/frappe/patches/v13_0/remove_duration_options.py b/frappe/patches/v13_0/remove_duration_options.py deleted file mode 100644 index 65d14c6725..0000000000 --- a/frappe/patches/v13_0/remove_duration_options.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt - -from __future__ import unicode_literals -import frappe - -def execute(): - if frappe.db.has_column('DocField', 'show_days'): - frappe.db.sql('alter table tabDocField drop column show_days') - - if frappe.db.has_column('DocField', 'show_seconds'): - frappe.db.sql('alter table tabDocField drop column show_seconds') - - frappe.clear_cache(doctype='DocField') \ No newline at end of file diff --git a/frappe/patches/v13_0/update_duration_options.py b/frappe/patches/v13_0/update_duration_options.py new file mode 100644 index 0000000000..60eef8fc93 --- /dev/null +++ b/frappe/patches/v13_0/update_duration_options.py @@ -0,0 +1,28 @@ +# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors +# MIT License. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.reload_doc('core', 'doctype', 'DocField') + + if frappe.db.has_column('DocField', 'show_days'): + frappe.db.sql(""" + UPDATE + tabDocField + SET + hide_days = 1 WHERE show_days = 0 + """) + frappe.db.sql_ddl('alter table tabDocField drop column show_days') + + if frappe.db.has_column('DocField', 'show_seconds'): + frappe.db.sql(""" + UPDATE + tabDocField + SET + hide_seconds = 1 WHERE show_seconds = 0 + """) + frappe.db.sql_ddl('alter table tabDocField drop column show_seconds') + + frappe.clear_cache(doctype='DocField') \ No newline at end of file From 529a2eb8086952f7cc6d4462bed16b8e5270f68f Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 9 Jun 2020 17:50:41 +0530 Subject: [PATCH 17/27] fix: condition for rendering source --- frappe/website/router.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/website/router.py b/frappe/website/router.py index 976bd9f3de..b291671a4a 100644 --- a/frappe/website/router.py +++ b/frappe/website/router.py @@ -278,10 +278,10 @@ def setup_source(page_info): if not page_info.base_template: page_info.base_template = get_base_template(page_info.route) - if page_info.template.endswith('.html') or page_info.template.endswith('.md'): + if page_info.template.endswith(('.html', '.md', )) and \ + '{%- extends' not in source and '{% extends' not in source: # set the source only if it contains raw content - if '{%- extends' not in source and '{% extends' not in source: - html = source + html = source # load css/js files js, css = '', '' From df1d3be9fbf91c22ef1326a930a1fe2c5bf3dc31 Mon Sep 17 00:00:00 2001 From: Vishal Dhayagude Date: Tue, 9 Jun 2020 18:28:27 +0530 Subject: [PATCH 18/27] fix(web_form) : web form file attachment link to specific doctype (#222) --- frappe/public/js/frappe/web_form/web_form.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frappe/public/js/frappe/web_form/web_form.js b/frappe/public/js/frappe/web_form/web_form.js index 4dc1a50bc4..8cde4c9ba5 100644 --- a/frappe/public/js/frappe/web_form/web_form.js +++ b/frappe/public/js/frappe/web_form/web_form.js @@ -139,6 +139,16 @@ export default class WebForm extends frappe.ui.FieldGroup { this.handle_success(response.message); frappe.web_form.events.trigger('after_save'); this.after_save && this.after_save(); + // args doctype and docname added to link doctype in file manager + frappe.call({ + type: 'POST', + method: "frappe.handler.upload_file", + args: { + file_url: response.message.attachment, + doctype: response.message.doctype, + docname: response.message.name + } + }); } }, always: function() { From 3db3e073aac135d711e4632db71728dd11cbee2f Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 9 Jun 2020 19:15:53 +0530 Subject: [PATCH 19/27] feat: remove flaky test for grid-pagination --- cypress/integration/grid_pagination.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cypress/integration/grid_pagination.js b/cypress/integration/grid_pagination.js index f03384cb93..b383f30bb8 100644 --- a/cypress/integration/grid_pagination.js +++ b/cypress/integration/grid_pagination.js @@ -40,12 +40,12 @@ context('Grid Pagination', () => { cy.get('@table').find('.current-page-number').should('contain', '20'); cy.get('@table').find('.total-page-number').should('contain', '20'); }); - it('deletes all rows', ()=> { - cy.visit('/desk#Form/Contact/Test Contact'); - cy.get('.frappe-control[data-fieldname="phone_nos"]').as('table'); - cy.get('@table').find('.grid-heading-row .grid-row-check').click({force: true}); - cy.get('@table').find('button.grid-remove-all-rows').click(); - cy.get('.modal-dialog .btn-primary').contains('Yes').click(); - cy.get('@table').find('.grid-body .grid-row').should('have.length', 0); - }); + // it('deletes all rows', ()=> { + // cy.visit('/desk#Form/Contact/Test Contact'); + // cy.get('.frappe-control[data-fieldname="phone_nos"]').as('table'); + // cy.get('@table').find('.grid-heading-row .grid-row-check').click({force: true}); + // cy.get('@table').find('button.grid-remove-all-rows').click(); + // cy.get('.modal-dialog .btn-primary').contains('Yes').click(); + // cy.get('@table').find('.grid-body .grid-row').should('have.length', 0); + // }); }); \ No newline at end of file From aa5b526fa7be22112e84f199774d8da0055f11f4 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 9 Jun 2020 20:11:38 +0530 Subject: [PATCH 20/27] fix(web_form): set only_select for Link fields in child table --- frappe/public/js/frappe/web_form/webform_script.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frappe/public/js/frappe/web_form/webform_script.js b/frappe/public/js/frappe/web_form/webform_script.js index 53d9701774..c3211de99f 100644 --- a/frappe/public/js/frappe/web_form/webform_script.js +++ b/frappe/public/js/frappe/web_form/webform_script.js @@ -95,6 +95,11 @@ frappe.ready(function() { }; df.fields = form_data[df.fieldname]; + $.each(df.fields || [], function(_i, field) { + if (field.fieldtype === "Link") { + field.only_select = true; + } + }); if (df.fieldtype === "Attach") { df.is_private = true; From b34c14cde31ab394806043c5e7dd305095a7153a Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 9 Jun 2020 23:19:11 +0530 Subject: [PATCH 21/27] fix: run handle_hold_time method in parent --- .../doctype/communication/communication.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index e2dab3b7fc..232d485f36 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -444,13 +444,12 @@ def update_parent_document_on_communication(doc): status_field = parent.meta.get_field("status") if status_field: - options = (status_field.options or '').splitlines() + options = (status_field.options or "").splitlines() # if status has a "Replied" option, then update the status for received communication - if ('Replied' in options) and doc.sent_or_received=="Received": - parent.status = "Open" - parent.flags.ignore_mandatory = True - parent.save() + if ("Replied" in options) and doc.sent_or_received == "Received": + parent.db_set("status", "Open") + parent.run_method("handle_hold_time", "Replied") apply_assignment_rule(parent) else: # update the modified date for document @@ -458,16 +457,16 @@ def update_parent_document_on_communication(doc): update_mins_to_first_communication(parent, doc) set_avg_response_time(parent, doc) - parent.run_method('notify_communication', doc) + parent.run_method("notify_communication", doc) parent.notify_update() def update_mins_to_first_communication(parent, communication): - if parent.meta.has_field('mins_to_first_response') and not parent.get('mins_to_first_response'): + if parent.meta.has_field("mins_to_first_response") and not parent.get("mins_to_first_response"): if is_system_user(communication.sender): first_responded_on = communication.creation - if parent.meta.has_field('first_responded_on') and communication.sent_or_received == "Sent": - parent.db_set('first_responded_on', first_responded_on) - parent.db_set('mins_to_first_response', round(time_diff_in_seconds(first_responded_on, parent.creation) / 60), 2) + if parent.meta.has_field("first_responded_on") and communication.sent_or_received == "Sent": + parent.db_set("first_responded_on", first_responded_on) + parent.db_set("mins_to_first_response", round(time_diff_in_seconds(first_responded_on, parent.creation) / 60), 2) def set_avg_response_time(parent, communication): if parent.meta.has_field("avg_response_time") and communication.sent_or_received == "Sent": From 5710d107e1aa6f1734e82cc39d3a57e1d0289493 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Wed, 10 Jun 2020 01:45:23 +0530 Subject: [PATCH 22/27] chore: Update website links --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 860958087e..7545249610 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

- + frappe

@@ -33,8 +33,8 @@ 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) -* [Documentation](https://frappe.io/docs) +* [Installation](https://frappeframework.com/docs/user/en/installation) +* [Documentation](https://frappeframework.com/docs) * [License](#license) ### Installation @@ -49,7 +49,7 @@ Full-stack web application framework that uses Python and MariaDB on the server ### Website For details and documentation, see the website -[https://frappe.io](https://frappe.io) +[https://frappeframework.com](https://frappeframework.com) ### License This repository has been released under the [MIT License](LICENSE). From cfa7afb08cb467b2c06a3cc366c7f760ba4afff1 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 10 Jun 2020 11:32:44 +0530 Subject: [PATCH 23/27] fix(doctor): update broken command behaviour --- frappe/commands/__init__.py | 6 ++++-- frappe/commands/scheduler.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frappe/commands/__init__.py b/frappe/commands/__init__.py index 42f4440547..b7294fff77 100644 --- a/frappe/commands/__init__.py +++ b/frappe/commands/__init__.py @@ -43,12 +43,14 @@ def pass_context(f): return click.pass_context(_func) -def get_site(context): +def get_site(context, raise_err=True): try: site = context.sites[0] return site except (IndexError, TypeError): - raise frappe.SiteNotSpecifiedError + if raise_err: + raise frappe.SiteNotSpecifiedError + return None def popen(command, *args, **kwargs): output = kwargs.get('output', True) diff --git a/frappe/commands/scheduler.py b/frappe/commands/scheduler.py index 511fac6e0d..bd9c9d2cb0 100755 --- a/frappe/commands/scheduler.py +++ b/frappe/commands/scheduler.py @@ -126,7 +126,7 @@ def doctor(context, site=None): "Get diagnostic info about background workers" from frappe.utils.doctor import doctor as _doctor if not site: - site = get_site(context) + site = get_site(context, raise_err=False) return _doctor(site=site) @click.command('show-pending-jobs') From ef9327c99fe1a4fcea4870de9a5082ba2c13b1e4 Mon Sep 17 00:00:00 2001 From: "Chinmay D. Pai" Date: Wed, 10 Jun 2020 13:23:39 +0530 Subject: [PATCH 24/27] fix: return 0 if no users are found if no users are present in the system, get_total_users returns None instead of 0 causing comparison issues Signed-off-by: Chinmay D. Pai --- frappe/core/doctype/user/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index 0c5ebc3ede..69ef617c15 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -841,11 +841,11 @@ def user_query(doctype, txt, searchfield, start, page_len, filters): def get_total_users(): """Returns total no. of system users""" - return frappe.db.sql('''SELECT SUM(`simultaneous_sessions`) + return cint(frappe.db.sql('''SELECT SUM(`simultaneous_sessions`) FROM `tabUser` WHERE `enabled` = 1 AND `user_type` = 'System User' - AND `name` NOT IN ({})'''.format(", ".join(["%s"]*len(STANDARD_USERS))), STANDARD_USERS)[0][0] + AND `name` NOT IN ({})'''.format(", ".join(["%s"]*len(STANDARD_USERS))), STANDARD_USERS)[0][0]) def get_system_users(exclude_users=None, limit=None): if not exclude_users: From fa14e474137bd40ba60c8260acfa5c0b38266b35 Mon Sep 17 00:00:00 2001 From: Chinmay Pai Date: Wed, 10 Jun 2020 14:15:53 +0530 Subject: [PATCH 25/27] chore: use flt instead of cint --- frappe/core/doctype/user/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index 69ef617c15..7b9266ff64 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals, print_function import frappe from frappe.model.document import Document -from frappe.utils import cint, has_gravatar, format_datetime, now_datetime, get_formatted_email, today +from frappe.utils import cint, flt, has_gravatar, format_datetime, now_datetime, get_formatted_email, today from frappe import throw, msgprint, _ from frappe.utils.password import update_password as _update_password from frappe.desk.notifications import clear_notifications @@ -841,7 +841,7 @@ def user_query(doctype, txt, searchfield, start, page_len, filters): def get_total_users(): """Returns total no. of system users""" - return cint(frappe.db.sql('''SELECT SUM(`simultaneous_sessions`) + return flt(frappe.db.sql('''SELECT SUM(`simultaneous_sessions`) FROM `tabUser` WHERE `enabled` = 1 AND `user_type` = 'System User' From 1ba65acb1fc441794b1e19826d463a36a09555e9 Mon Sep 17 00:00:00 2001 From: Himanshu Date: Wed, 10 Jun 2020 15:09:59 +0530 Subject: [PATCH 26/27] fix: Add label for Text Editor --- frappe/templates/print_formats/standard_macros.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/templates/print_formats/standard_macros.html b/frappe/templates/print_formats/standard_macros.html index d684c60a2d..a94032efbe 100644 --- a/frappe/templates/print_formats/standard_macros.html +++ b/frappe/templates/print_formats/standard_macros.html @@ -34,8 +34,8 @@ {%- if data -%} {%- set visible_columns = get_visible_columns(doc.get(df.fieldname), table_meta, df) -%} -
+
@@ -96,7 +96,7 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}" {%- macro render_text_field(df, doc) -%} {%- if doc.get(df.fieldname) != None -%}
- {%- if df.fieldtype in ("Text", "Code", "Long Text") %}{%- endif %} + {%- if df.fieldtype in ("Text", "Code", "Long Text", "Text Editor") %}{%- endif %} {%- if df.fieldtype=="Code" %}
{{ doc.get(df.fieldname) }}
{% else -%} From 8ba041565b76459c237b93fe178d7a1a4e46a1cf Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 10 Jun 2020 19:36:57 +0530 Subject: [PATCH 27/27] fix: show login dropdown if already logged on --- frappe/templates/includes/navbar/navbar_login.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/templates/includes/navbar/navbar_login.html b/frappe/templates/includes/navbar/navbar_login.html index 4e2c6dc93b..2a58efe039 100644 --- a/frappe/templates/includes/navbar/navbar_login.html +++ b/frappe/templates/includes/navbar/navbar_login.html @@ -1,5 +1,5 @@ -{% if not only_static and not hide_login %} +{% if not only_static %} {% if frappe.session.user != 'Guest' %}