fix: add back a limitation to number of the documents
Don't allow printing more than 500 documents Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
9bf22b79e4
commit
1caae030ae
1 changed files with 8 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ export default class BulkOperations {
|
|||
const is_submittable = frappe.model.is_submittable(this.doctype);
|
||||
const allow_print_for_cancelled = cint(print_settings.allow_print_for_cancelled);
|
||||
const letterheads = this.get_letterhead_options();
|
||||
const MAX_PRINT_LIMIT = 500;
|
||||
|
||||
const valid_docs = docs
|
||||
.filter((doc) => {
|
||||
|
|
@ -35,6 +36,13 @@ export default class BulkOperations {
|
|||
return;
|
||||
}
|
||||
|
||||
if (valid_docs.length > MAX_PRINT_LIMIT) {
|
||||
frappe.msgprint(
|
||||
__("You can only print upto {0} documents at a time", [MAX_PRINT_LIMIT])
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const dialog = new frappe.ui.Dialog({
|
||||
title: __("Print Documents"),
|
||||
fields: [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue