`);
@@ -37,7 +40,7 @@ class BaseTimeline {
${label}
`);
action_btn.click(action);
- this.timeline_actions_wrapper.append(action_btn);
+ this.timeline_actions_wrapper.find('.action-buttons').append(action_btn);
return action_btn;
}
diff --git a/frappe/public/js/frappe/form/footer/form_timeline.js b/frappe/public/js/frappe/form/footer/form_timeline.js
index f278d1b64b..d440874f36 100644
--- a/frappe/public/js/frappe/form/footer/form_timeline.js
+++ b/frappe/public/js/frappe/form/footer/form_timeline.js
@@ -77,12 +77,14 @@ class FormTimeline extends BaseTimeline {
const message = __("Add to this activity by mailing to {0}", [link.bold()]);
this.document_email_link_wrapper = $(`
-
+
-
${message}
+
+ ${message}
+
`);
- this.timeline_wrapper.append(this.document_email_link_wrapper);
+ this.timeline_actions_wrapper.append(this.document_email_link_wrapper);
this.document_email_link_wrapper
.find('.document-email-link')
diff --git a/frappe/public/js/frappe/form/form.js b/frappe/public/js/frappe/form/form.js
index 1459b38df6..5c0b6b1399 100644
--- a/frappe/public/js/frappe/form/form.js
+++ b/frappe/public/js/frappe/form/form.js
@@ -943,7 +943,10 @@ frappe.ui.form.Form = class FrappeForm {
// re-enable buttons
resolve();
}
- frappe.throw (__("No permission to '{0}' {1}", [__(action), __(this.doc.doctype)]));
+
+ frappe.throw(
+ __("No permission to '{0}' {1}", [__(action), __(this.doc.doctype)], "{0} = verb, {1} = object")
+ );
}
}
@@ -1146,8 +1149,7 @@ frappe.ui.form.Form = class FrappeForm {
subject: __(this.meta.name) + ': ' + this.docname,
recipients: this.doc.email || this.doc.email_id || this.doc.contact_email,
attach_document_print: true,
- message: message,
- real_name: this.doc.real_name || this.doc.contact_display || this.doc.contact_name
+ message: message
});
}
diff --git a/frappe/public/js/frappe/form/multi_select_dialog.js b/frappe/public/js/frappe/form/multi_select_dialog.js
index bc0286e62d..bc5f7a9b52 100644
--- a/frappe/public/js/frappe/form/multi_select_dialog.js
+++ b/frappe/public/js/frappe/form/multi_select_dialog.js
@@ -150,8 +150,12 @@ frappe.ui.form.MultiSelectDialog = class MultiSelectDialog {
});
}
+ is_child_selection_enabled() {
+ return this.dialog.fields_dict['allow_child_item_selection'].get_value();
+ }
+
toggle_child_selection() {
- if (this.dialog.fields_dict['allow_child_item_selection'].get_value()) {
+ if (this.is_child_selection_enabled()) {
this.show_child_results();
} else {
this.child_results = [];
@@ -289,7 +293,11 @@ frappe.ui.form.MultiSelectDialog = class MultiSelectDialog {
parent: this.dialog.get_field('filter_area').$wrapper,
doctype: this.doctype,
on_change: () => {
- this.get_results();
+ if (this.is_child_selection_enabled()) {
+ this.show_child_results();
+ } else {
+ this.get_results();
+ }
}
});
// 'Apply Filter' breaks since the filers are not in a popover
@@ -325,7 +333,11 @@ frappe.ui.form.MultiSelectDialog = class MultiSelectDialog {
this.$parent.find('.input-with-feedback').on('change', () => {
frappe.flags.auto_scroll = false;
- this.get_results();
+ if (this.is_child_selection_enabled()) {
+ this.show_child_results();
+ } else {
+ this.get_results();
+ }
});
this.$parent.find('[data-fieldtype="Data"]').on('input', () => {
@@ -333,8 +345,12 @@ frappe.ui.form.MultiSelectDialog = class MultiSelectDialog {
clearTimeout($this.data('timeout'));
$this.data('timeout', setTimeout(function () {
frappe.flags.auto_scroll = false;
- me.empty_list();
- me.get_results();
+ if (me.is_child_selection_enabled()) {
+ me.show_child_results();
+ } else {
+ me.empty_list();
+ me.get_results();
+ }
}, 300));
});
}
diff --git a/frappe/public/js/frappe/form/save.js b/frappe/public/js/frappe/form/save.js
index 1a45a28b06..da642b7ca5 100644
--- a/frappe/public/js/frappe/form/save.js
+++ b/frappe/public/js/frappe/form/save.js
@@ -7,12 +7,12 @@ frappe.ui.form.save = function (frm, action, callback, btn) {
$(btn).prop("disabled", true);
// specified here because there are keyboard shortcuts to save
- var working_label = {
- "Save": __("Saving"),
- "Submit": __("Submitting"),
- "Update": __("Updating"),
- "Amend": __("Amending"),
- "Cancel": __("Cancelling")
+ const working_label = {
+ "Save": __("Saving", null, "Freeze message while saving a document"),
+ "Submit": __("Submitting", null, "Freeze message while submitting a document"),
+ "Update": __("Updating", null, "Freeze message while updating a document"),
+ "Amend": __("Amending", null, "Freeze message while amending a document"),
+ "Cancel": __("Cancelling", null, "Freeze message while cancelling a document"),
}[toTitle(action)];
var freeze_message = working_label ? __(working_label) : "";
@@ -154,8 +154,8 @@ frappe.ui.form.save = function (frm, action, callback, btn) {
if (error_fields.length) {
let meta = frappe.get_meta(doc.doctype);
if (meta.istable) {
- var message = __('Mandatory fields required in table {0}, Row {1}',
- [__(frappe.meta.docfield_map[doc.parenttype][doc.parentfield].label).bold(), doc.idx]);
+ const table_label = __(frappe.meta.docfield_map[doc.parenttype][doc.parentfield].label).bold();
+ var message = __('Mandatory fields required in table {0}, Row {1}', [table_label, doc.idx]);
} else {
var message = __('Mandatory fields required in {0}', [__(doc.doctype)]);
}
@@ -285,4 +285,3 @@ frappe.ui.form.update_calling_link = (newdoc) => {
});
}
}
-
diff --git a/frappe/public/js/frappe/form/script_manager.js b/frappe/public/js/frappe/form/script_manager.js
index d1732ee702..6169fa75b8 100644
--- a/frappe/public/js/frappe/form/script_manager.js
+++ b/frappe/public/js/frappe/form/script_manager.js
@@ -192,7 +192,7 @@ frappe.ui.form.ScriptManager = class ScriptManager {
}
function setup_add_fetch(df) {
- if ((['Data', 'Read Only', 'Text', 'Small Text', 'Currency', 'Check',
+ if ((['Data', 'Read Only', 'Text', 'Small Text', 'Currency', 'Check', 'Attach Image',
'Text Editor', 'Code', 'Link', 'Float', 'Int', 'Date', 'Select', 'Duration'].includes(df.fieldtype) || df.read_only==1)
&& df.fetch_from && df.fetch_from.indexOf(".")!=-1) {
var parts = df.fetch_from.split(".");
diff --git a/frappe/public/js/frappe/form/templates/form_sidebar.html b/frappe/public/js/frappe/form/templates/form_sidebar.html
index efa8b9ea5e..dcea2f4647 100644
--- a/frappe/public/js/frappe/form/templates/form_sidebar.html
+++ b/frappe/public/js/frappe/form/templates/form_sidebar.html
@@ -1,5 +1,5 @@
-