From 59bd0931057dfdbe95ae0eca263ceb7e0862ebda Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 4 Nov 2020 13:01:32 +0530 Subject: [PATCH 1/9] fix: Hide child doctypes from Open Documents --- .../notification_settings/notification_settings.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frappe/desk/doctype/notification_settings/notification_settings.js b/frappe/desk/doctype/notification_settings/notification_settings.js index b8b7f37a4f..88dc145be2 100644 --- a/frappe/desk/doctype/notification_settings/notification_settings.js +++ b/frappe/desk/doctype/notification_settings/notification_settings.js @@ -2,12 +2,19 @@ // For license information, please see license.txt frappe.ui.form.on('Notification Settings', { - onload: () => { + onload: (frm) => { frappe.breadcrumbs.add({ label: __('Settings'), route: '#modules/Settings', type: 'Custom' }); + frm.set_query('subscribed_documents', () => { + return { + filters: { + istable: 0 + } + }; + }); }, refresh: (frm) => { From f6fc12578acd4bf176d3c98d122798cc91106c78 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 4 Nov 2020 13:02:00 +0530 Subject: [PATCH 2/9] fix: Rename Subscribed Documents to Open Documents --- .../notification_settings.json | 45 ++++++------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/frappe/desk/doctype/notification_settings/notification_settings.json b/frappe/desk/doctype/notification_settings/notification_settings.json index 85f93e156e..fc12022e89 100644 --- a/frappe/desk/doctype/notification_settings/notification_settings.json +++ b/frappe/desk/doctype/notification_settings/notification_settings.json @@ -22,68 +22,52 @@ "default": "1", "fieldname": "enabled", "fieldtype": "Check", - "label": "Enabled", - "show_days": 1, - "show_seconds": 1 + "label": "Enabled" }, { "fieldname": "subscribed_documents", "fieldtype": "Table MultiSelect", - "label": "Subscribed Documents", - "options": "Notification Subscribed Document", - "show_days": 1, - "show_seconds": 1 + "label": "Open Documents", + "options": "Notification Subscribed Document" }, { "fieldname": "column_break_3", "fieldtype": "Section Break", - "label": "Email Settings", - "show_days": 1, - "show_seconds": 1 + "label": "Email Settings" }, { "default": "1", "fieldname": "enable_email_notifications", "fieldtype": "Check", - "label": "Enable Email Notifications", - "show_days": 1, - "show_seconds": 1 + "label": "Enable Email Notifications" }, { "default": "1", "depends_on": "enable_email_notifications", "fieldname": "enable_email_mention", "fieldtype": "Check", - "label": "Mentions", - "show_days": 1, - "show_seconds": 1 + "label": "Mentions" }, { "default": "1", "depends_on": "enable_email_notifications", "fieldname": "enable_email_assignment", "fieldtype": "Check", - "label": "Assignments", - "show_days": 1, - "show_seconds": 1 + "label": "Assignments" }, { "default": "1", "depends_on": "enable_email_notifications", "fieldname": "enable_email_energy_point", "fieldtype": "Check", - "label": "Energy Points", - "show_days": 1, - "show_seconds": 1 + "label": "Energy Points" }, { "default": "1", "depends_on": "enable_email_notifications", "fieldname": "enable_email_share", "fieldtype": "Check", - "label": "Document Share", - "show_days": 1, - "show_seconds": 1 + "label": "Document Share" }, { "default": "__user", @@ -92,23 +76,20 @@ "hidden": 1, "label": "User", "options": "User", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "default": "0", "fieldname": "seen", "fieldtype": "Check", "hidden": 1, - "label": "Seen", - "show_days": 1, - "show_seconds": 1 + "label": "Seen" } ], "in_create": 1, + "index_web_pages_for_search": 1, "links": [], - "modified": "2020-05-31 22:16:40.798019", + "modified": "2020-11-04 12:54:57.989317", "modified_by": "Administrator", "module": "Desk", "name": "Notification Settings", From d012d9145cad2d889e3bcdfe5783a722fa7f6d78 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 4 Nov 2020 14:42:38 +0530 Subject: [PATCH 3/9] refactor: explicitly enable and disable report --- frappe/core/doctype/report/report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/report/report.js b/frappe/core/doctype/report/report.js index 14e9b3a901..f78fd3e812 100644 --- a/frappe/core/doctype/report/report.js +++ b/frappe/core/doctype/report/report.js @@ -2,7 +2,9 @@ frappe.ui.form.on('Report', { refresh: function(frm) { if (frm.doc.is_standard === "Yes" && !frappe.boot.developer_mode) { // make the document read-only - frm.set_read_only(); + frm.disable_form(); + } else { + frm.enable_save(); } let doc = frm.doc; @@ -32,8 +34,6 @@ frappe.ui.form.on('Report', { }); }, doc.disabled ? "fa fa-check" : "fa fa-off"); } - - frm.events.report_type(frm); }, ref_doctype: function(frm) { From b3bcc9f1bfa8d37f98efabb26d24dd39eba94144 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 4 Nov 2020 15:03:52 +0530 Subject: [PATCH 4/9] fix: toggle enable on refresh Moving between a read-only and non-read-only doc, the form save status would not be updated, this commit fixes it --- frappe/public/js/frappe/form/form.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js index 1c1c7b1f01..8e41e096fb 100644 --- a/frappe/public/js/frappe/form/form.js +++ b/frappe/public/js/frappe/form/form.js @@ -275,6 +275,10 @@ frappe.ui.form.Form = class FrappeForm { this.read_only = frappe.workflow.is_read_only(this.doctype, this.docname); if (this.read_only) this.set_read_only(true); + if (this.save_disabled && !this.read_only) { + this.enable_save() + } + // check if doctype is already open if (!this.opendocs[this.docname]) { this.check_doctype_conflict(this.docname); From a4462a83d5fb8cba68897d11d7f18990617558fc Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 4 Nov 2020 15:19:09 +0530 Subject: [PATCH 5/9] style: add semi --- frappe/public/js/frappe/form/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js index 8e41e096fb..904ab2e1b7 100644 --- a/frappe/public/js/frappe/form/form.js +++ b/frappe/public/js/frappe/form/form.js @@ -276,7 +276,7 @@ frappe.ui.form.Form = class FrappeForm { if (this.read_only) this.set_read_only(true); if (this.save_disabled && !this.read_only) { - this.enable_save() + this.enable_save(); } // check if doctype is already open From 505f4afc6a5c1ede0451bc72026431d7263cd389 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 4 Nov 2020 15:45:06 +0530 Subject: [PATCH 6/9] refactor: update disable_save variable instead of calling this.enable_save --- frappe/public/js/frappe/form/form.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js index 904ab2e1b7..bb9e8c22d1 100644 --- a/frappe/public/js/frappe/form/form.js +++ b/frappe/public/js/frappe/form/form.js @@ -261,7 +261,7 @@ frappe.ui.form.Form = class FrappeForm { cur_frm = this; if(this.docname) { // document to show - + this.save_disabled = false; // set the doc this.doc = frappe.get_doc(this.doctype, this.docname); @@ -275,10 +275,6 @@ frappe.ui.form.Form = class FrappeForm { this.read_only = frappe.workflow.is_read_only(this.doctype, this.docname); if (this.read_only) this.set_read_only(true); - if (this.save_disabled && !this.read_only) { - this.enable_save(); - } - // check if doctype is already open if (!this.opendocs[this.docname]) { this.check_doctype_conflict(this.docname); From d330575d4940f3b42e20cff2add36edfee6385ee Mon Sep 17 00:00:00 2001 From: marination Date: Wed, 4 Nov 2020 23:18:39 +0530 Subject: [PATCH 7/9] fix: Total Row in Checkbox Column Reports --- frappe/public/js/frappe/views/reports/query_report.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 53cee5b348..2d2282be43 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -1043,7 +1043,8 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { // applied to Float, Currency fields, needed only for currency formatting. // make first data column have value 'Total' let index = 1; - if (this.datatable && this.datatable.options.checkboxColumn) index = 2; + let datatable = this.report_settings.get_datatable_options({}); + if (datatable && datatable.checkboxColumn) index = 2; if (column.colIndex === index && !value) { value = "Total"; From 201fe27f26bab126a922da1f03c521e7def5d443 Mon Sep 17 00:00:00 2001 From: marination Date: Thu, 5 Nov 2020 10:28:41 +0530 Subject: [PATCH 8/9] fix: Check of `get_datatable_options` exists in report settings --- frappe/public/js/frappe/views/reports/query_report.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index 2d2282be43..f8bd1cdea8 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -1043,8 +1043,11 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { // applied to Float, Currency fields, needed only for currency formatting. // make first data column have value 'Total' let index = 1; - let datatable = this.report_settings.get_datatable_options({}); - if (datatable && datatable.checkboxColumn) index = 2; + + if (this.report_settings.get_datatable_options) { + let datatable = this.report_settings.get_datatable_options({}); + if (datatable && datatable.checkboxColumn) index = 2; + } if (column.colIndex === index && !value) { value = "Total"; From f6b0596c8f93689d942ca1232623bdf3397a550e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2020 11:21:16 +0530 Subject: [PATCH 9/9] feat(Gantt View): allow overriding calendar settings (bp #11807) (#11874) (cherry picked from commit 040d7ff0d41ef8136a5a26a590e799465a4aa451) Co-authored-by: prssanna --- frappe/public/js/frappe/views/gantt/gantt_view.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/views/gantt/gantt_view.js b/frappe/public/js/frappe/views/gantt/gantt_view.js index 6fb4688a48..6ab05be96f 100644 --- a/frappe/public/js/frappe/views/gantt/gantt_view.js +++ b/frappe/public/js/frappe/views/gantt/gantt_view.js @@ -10,7 +10,12 @@ frappe.views.GanttView = class GanttView extends frappe.views.ListView { .then(() => { this.page_title = this.page_title + ' ' + __('Gantt'); this.calendar_settings = frappe.views.calendar[this.doctype] || {}; - if(this.calendar_settings.order_by) { + + if (typeof this.calendar_settings.gantt == 'object') { + Object.assign(this.calendar_settings, this.calendar_settings.gantt); + } + + if (this.calendar_settings.order_by) { this.sort_by = this.calendar_settings.order_by; this.sort_order = 'asc'; } else {