Files
erpnext/erpnext/public/js/bulk_transaction_processing.js
Mihir Kandoi 8cd420953c chore: rewrite user-facing JS messages in Public module
Conservative cleanup of frappe.throw/msgprint messages per the message style
guide; meaning, severity, and .format() arguments are unchanged:

- index bare {} placeholders as {0}/{1}/... so translators can reorder
- move f-strings / .format() / concatenation out of _() (they break gettext
  extraction and never translate)
- wrap translatable dynamic values (DocType/Select labels) in _()
- fix grammar and colloquialisms
- drop no-op _() wrapping runtime-built strings

Part of #53976.
2026-06-25 17:44:14 +05:30

38 lines
1.0 KiB
JavaScript

frappe.provide("erpnext.bulk_transaction_processing");
$.extend(erpnext.bulk_transaction_processing, {
create: function (listview, from_doctype, to_doctype, args) {
let checked_items = listview.get_checked_items();
const doc_name = [];
checked_items.forEach((Item) => {
if (Item.docstatus == 0) {
doc_name.push(Item.name);
}
});
let count_of_rows = checked_items.length;
frappe.confirm(__("Create {0} {1} ?", [count_of_rows, __(to_doctype)]), () => {
if (doc_name.length == 0) {
frappe
.call({
method: "erpnext.utilities.bulk_transaction.transaction_processing",
args: {
data: checked_items,
from_doctype: from_doctype,
to_doctype: to_doctype,
args: args,
},
})
.then(() => {});
if (count_of_rows > 10) {
frappe.show_alert(
__("Starting a background job to create {0} {1}", [count_of_rows, __(to_doctype)])
);
}
} else {
frappe.msgprint(__("Selected document must be in submitted state"));
}
});
},
});