Skip to content

Commit

Permalink
Merge pull request #20942 from frappe/version-14-hotfix
Browse files Browse the repository at this point in the history
chore: release v14
  • Loading branch information
phot0n committed May 9, 2023
2 parents c2e6c8c + 35165d0 commit 67015d6
Show file tree
Hide file tree
Showing 44 changed files with 778 additions and 575 deletions.
4 changes: 1 addition & 3 deletions frappe/automation/doctype/auto_repeat/auto_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,10 @@ def send_notification(self, new_doc):
elif "{" in self.message:
message = frappe.render_template(self.message, {"doc": new_doc})

recipients = self.recipients.split("\n")

frappe.sendmail(
reference_doctype=new_doc.doctype,
reference_name=new_doc.name,
recipients=recipients,
recipients=self.recipients,
subject=subject,
content=message,
attachments=attachments,
Expand Down
2 changes: 1 addition & 1 deletion frappe/contacts/doctype/address/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_default_address(doctype, name, sort_key="is_primary_address"):


@frappe.whitelist()
def get_address_display(address_dict):
def get_address_display(address_dict: dict | str | None = None) -> str | None:
if not address_dict:
return

Expand Down
3 changes: 3 additions & 0 deletions frappe/core/doctype/data_export/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import frappe.permissions
from frappe import _
from frappe.core.doctype.access_log.access_log import make_access_log
from frappe.model.utils import is_virtual_doctype
from frappe.utils import cint, cstr, format_datetime, format_duration, formatdate, parse_json
from frappe.utils.csvutils import UnicodeWriter

Expand Down Expand Up @@ -368,6 +369,8 @@ def add_data(self):
if self.all_doctypes:
# add child tables
for c in self.child_doctypes:
if is_virtual_doctype(c["doctype"]):
continue
child_doctype_table = DocType(c["doctype"])
data_row = (
frappe.qb.from_(child_doctype_table)
Expand Down
1 change: 1 addition & 0 deletions frappe/core/doctype/log_settings/log_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"Error Snapshot": 30,
"Scheduled Job Log": 90,
"Route History": 90,
"Prepared Report": 30,
"Webhook Request Log": 30,
}

Expand Down
9 changes: 8 additions & 1 deletion frappe/core/doctype/prepared_report/prepared_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// For license information, please see license.txt

frappe.ui.form.on("Prepared Report", {
onload: function (frm) {
render_filter_values: function (frm) {
var wrapper = $(frm.fields_dict["filter_values"].wrapper).empty();

let filter_table = $(`<table class="table table-bordered">
Expand All @@ -16,6 +16,7 @@ frappe.ui.form.on("Prepared Report", {
</table>`);

const filters = JSON.parse(frm.doc.filters);
frm.toggle_display(["filter_values"], !$.isEmptyObject(filters));

Object.keys(filters).forEach((key) => {
const filter_row = $(`<tr>
Expand All @@ -30,6 +31,12 @@ frappe.ui.form.on("Prepared Report", {

refresh: function (frm) {
frm.disable_save();
frm.events.render_filter_values(frm);

// always keep report_name hidden - we do this as we can't set mandatory and hidden
// property on a docfield at the same time
frm.toggle_display(["report_name"], 0);

if (frm.doc.status == "Completed") {
frm.page.set_primary_action(__("Show Report"), () => {
frappe.set_route(
Expand Down
76 changes: 44 additions & 32 deletions frappe/core/doctype/prepared_report/prepared_report.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
{
"actions": [],
"autoname": "REP.#####",
"autoname": "hash",
"creation": "2018-06-25 18:39:11.152960",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"report_name",
"ref_report_doctype",
"status",
"report_name",
"queued_by",
"job_id",
"column_break_4",
"report_start_time",
"queued_at",
"report_end_time",
"section_break_7",
"error_message",
"filters_sb",
"filters",
"filter_values",
"columns"
"filter_values"
],
"fields": [
{
"fieldname": "report_name",
"fieldtype": "Data",
"label": "Report Name",
"read_only": 1
},
{
"fieldname": "ref_report_doctype",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Report Type",
"options": "Report",
"read_only": 1
"read_only": 1,
"reqd": 1
},
{
"default": "Queued",
Expand All @@ -49,16 +42,10 @@
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fieldname": "report_start_time",
"fieldtype": "Datetime",
"label": "Report Start Time",
"read_only": 1
},
{
"fieldname": "report_end_time",
"fieldtype": "Datetime",
"label": "Report End Time",
"label": "Finished At",
"read_only": 1
},
{
Expand Down Expand Up @@ -92,22 +79,35 @@
"label": "Filter Values"
},
{
"fieldname": "columns",
"fieldtype": "Code",
"hidden": 1,
"label": "Columns",
"fieldname": "job_id",
"fieldtype": "Link",
"label": "Job ID",
"no_copy": 1,
"print_hide": 1,
"options": "RQ Job",
"read_only": 1
},
{
"fieldname": "queued_by",
"fieldtype": "Data",
"is_virtual": 1,
"label": "Queued By",
"read_only": 1
},
{
"fieldname": "queued_at",
"fieldtype": "Datetime",
"is_virtual": 1,
"label": "Queued At",
"read_only": 1
}
],
"in_create": 1,
"links": [],
"modified": "2022-06-13 06:20:34.496412",
"modified": "2022-05-03 21:29:39.883803",
"modified_by": "Administrator",
"module": "Core",
"name": "Prepared Report",
"naming_rule": "Expression (old style)",
"naming_rule": "Random",
"owner": "Administrator",
"permissions": [
{
Expand All @@ -134,7 +134,19 @@
],
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "ref_report_doctype",
"track_changes": 1
"states": [
{
"color": "Blue",
"title": "Queued"
},
{
"color": "Red",
"title": "Error"
},
{
"color": "Green",
"title": "Completed"
}
],
"title_field": "report_name"
}
Loading

0 comments on commit 67015d6

Please sign in to comment.