Merge pull request #20853 from rtdany10/bulk-print-changes
This commit is contained in:
commit
fa80cfd2cf
2 changed files with 11 additions and 4 deletions
|
|
@ -9,6 +9,7 @@ export default class BulkOperations {
|
|||
const allow_print_for_draft = cint(print_settings.allow_print_for_draft);
|
||||
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 valid_docs = docs
|
||||
.filter((doc) => {
|
||||
|
|
@ -41,14 +42,15 @@ export default class BulkOperations {
|
|||
fieldtype: "Select",
|
||||
label: __("Letter Head"),
|
||||
fieldname: "letter_sel",
|
||||
default: __("No Letterhead"),
|
||||
options: this.get_letterhead_options(),
|
||||
options: letterheads,
|
||||
default: letterheads[0],
|
||||
},
|
||||
{
|
||||
fieldtype: "Select",
|
||||
label: __("Print Format"),
|
||||
fieldname: "print_sel",
|
||||
options: frappe.meta.get_print_formats(this.doctype),
|
||||
default: frappe.get_meta(this.doctype).default_print_format,
|
||||
},
|
||||
{
|
||||
fieldtype: "Select",
|
||||
|
|
@ -127,13 +129,18 @@ export default class BulkOperations {
|
|||
args: {
|
||||
doctype: "Letter Head",
|
||||
fields: ["name", "is_default"],
|
||||
filters: { disabled: 0 },
|
||||
limit_page_length: 0,
|
||||
},
|
||||
async: false,
|
||||
callback(r) {
|
||||
if (r.message) {
|
||||
r.message.forEach((letterhead) => {
|
||||
letterhead_options.push(letterhead.name);
|
||||
if (letterhead.is_default) {
|
||||
letterhead_options.unshift(letterhead.name);
|
||||
} else {
|
||||
letterhead_options.push(letterhead.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ def download_multi_pdf(
|
|||
frappe.local.response.filename = f"{name}.pdf"
|
||||
|
||||
frappe.local.response.filecontent = read_multi_pdf(output)
|
||||
frappe.local.response.type = "download"
|
||||
frappe.local.response.type = "pdf"
|
||||
|
||||
|
||||
def read_multi_pdf(output):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue