Merge pull request #56484 from mihir-kandoi/messages-js/accounts

chore: rewrite user-facing JS messages in accounts module
This commit is contained in:
Mihir Kandoi
2026-06-25 17:46:49 +05:30
committed by GitHub
7 changed files with 15 additions and 15 deletions

View File

@@ -236,9 +236,9 @@ frappe.treeview_settings["Account"] = {
function () { function () {
let root_company = treeview.page.fields_dict.root_company.get_value(); let root_company = treeview.page.fields_dict.root_company.get_value();
if (root_company) { if (root_company) {
frappe.throw(__("Please add the account to root level Company - {0}"), [ frappe.throw(
root_company, __("Please add the account to root level Company - {0}", [root_company])
]); );
} else { } else {
treeview.new_node(); treeview.new_node();
} }

View File

@@ -136,7 +136,7 @@ frappe.ui.form.on("Exchange Rate Revaluation Account", {
var get_account_details = function (frm, cdt, cdn) { var get_account_details = function (frm, cdt, cdn) {
var row = frappe.get_doc(cdt, cdn); var row = frappe.get_doc(cdt, cdn);
if (!frm.doc.company || !frm.doc.posting_date) { if (!frm.doc.company || !frm.doc.posting_date) {
frappe.throw(__("Please select Company and Posting Date to getting entries")); frappe.throw(__("Please select Company and Posting Date to get entries"));
} }
frappe.call({ frappe.call({
method: "erpnext.accounts.doctype.exchange_rate_revaluation.exchange_rate_revaluation.get_account_details", method: "erpnext.accounts.doctype.exchange_rate_revaluation.exchange_rate_revaluation.get_account_details",

View File

@@ -36,7 +36,7 @@ frappe.ui.form.on("Loyalty Program", {
)} )}
</li> </li>
<li> <li>
${__("One customer can be part of only single Loyalty Program.")} ${__("One customer can be part of only a single Loyalty Program.")}
</li> </li>
</ul> </ul>
</td></tr> </td></tr>
@@ -62,7 +62,7 @@ frappe.ui.form.on("Loyalty Program", {
refresh: function (frm) { refresh: function (frm) {
if (frm.doc.loyalty_program_type === "Single Tier Program" && frm.doc.collection_rules.length > 1) { if (frm.doc.loyalty_program_type === "Single Tier Program" && frm.doc.collection_rules.length > 1) {
frappe.throw( frappe.throw(
__("Please select the Multiple Tier Program type for more than one collection rules.") __("Please select the Multiple Tier Program type for more than one collection rule.")
); );
} }
}, },

View File

@@ -977,7 +977,7 @@ frappe.ui.form.on("Payment Entry", {
let to_field = fields[key][1]; let to_field = fields[key][1];
if (filters[from_field] && !filters[to_field]) { if (filters[from_field] && !filters[to_field]) {
frappe.throw(__("Error: {0} is mandatory field", [to_field.replace(/_/g, " ")])); frappe.throw(__("Error: {0} is a mandatory field", [to_field.replace(/_/g, " ")]));
} else if (filters[from_field] && filters[from_field] > filters[to_field]) { } else if (filters[from_field] && filters[from_field] > filters[to_field]) {
frappe.throw( frappe.throw(
__("{0}: {1} must be less than {2}", [ __("{0}: {1} must be less than {2}", [

View File

@@ -61,7 +61,7 @@ frappe.ui.form.on("Process Payment Reconciliation", {
}, },
}).then((r) => { }).then((r) => {
if (!r.exc) { if (!r.exc) {
frappe.show_alert(__("Job Started")); frappe.show_alert(__("Job started"));
frm.reload_doc(); frm.reload_doc();
} }
}); });
@@ -103,7 +103,7 @@ frappe.ui.form.on("Process Payment Reconciliation", {
}, },
}).then((r) => { }).then((r) => {
if (!r.exc) { if (!r.exc) {
frappe.show_alert(__("Job Paused")); frappe.show_alert(__("Job paused"));
frm.reload_doc(); frm.reload_doc();
} }
}); });

View File

@@ -17,9 +17,9 @@ frappe.ui.form.on("Process Statement Of Accounts", {
}, },
callback: function (r) { callback: function (r) {
if (r && r.message) { if (r && r.message) {
frappe.show_alert({ message: __("Emails Queued"), indicator: "blue" }); frappe.show_alert({ message: __("Emails queued"), indicator: "blue" });
} else { } else {
frappe.msgprint(__("No Records for these settings.")); frappe.msgprint(__("No records for these settings."));
} }
}, },
}); });
@@ -36,7 +36,7 @@ frappe.ui.form.on("Process Statement Of Accounts", {
type: "GET", type: "GET",
success: function (result) { success: function (result) {
if (jQuery.isEmptyObject(result)) { if (jQuery.isEmptyObject(result)) {
frappe.msgprint(__("No Records for these settings.")); frappe.msgprint(__("No records for these settings."));
} else { } else {
window.location = url; window.location = url;
} }
@@ -161,13 +161,13 @@ frappe.ui.form.on("Process Statement Of Accounts", {
} }
frm.refresh_field("customers"); frm.refresh_field("customers");
} else { } else {
frappe.throw(__("No Customers found with selected options.")); frappe.throw(__("No customers found with selected options."));
} }
} }
}, },
}); });
} else { } else {
frappe.throw("Enter " + frm.doc.customer_collection + " name."); frappe.throw(__("Enter {0} name.", [frm.doc.customer_collection]));
} }
}, },
}); });

View File

@@ -436,7 +436,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
if (!me.frm.doc.customer) { if (!me.frm.doc.customer) {
frappe.throw({ frappe.throw({
title: __("Mandatory"), title: __("Mandatory"),
message: __("Please Select a Customer"), message: __("Please select a Customer"),
}); });
} }
erpnext.utils.map_current_doc({ erpnext.utils.map_current_doc({