File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33window . pdf_on_submit = window . pdf_on_submit || { } ;
44
5- // Doctypes that support PDF button
5+ // Common doctypes with PDF button enabled by default
6+ // To enable for other doctypes, add a Client Script:
7+ // frappe.ui.form.on("Your DocType", { refresh: pdf_on_submit.add_pdf_button });
68pdf_on_submit . ALLOWED_DOCTYPES = [
79 "Quotation" ,
810 "Sales Order" ,
Original file line number Diff line number Diff line change 33from pdf_on_submit .attach_pdf import get_matching_enabled_doctype
44
55
6- ALLOWED_DOCTYPES = [
7- "Quotation" ,
8- "Sales Order" ,
9- "Sales Invoice" ,
10- "Delivery Note" ,
11- "Dunning" ,
12- "Request for Quotation" ,
13- "Supplier Quotation" ,
14- "Purchase Order" ,
15- "Purchase Invoice" ,
16- "Purchase Receipt" ,
17- ]
18-
19-
206@frappe .whitelist ()
217def get_print_details (doctype : str , docname : str ) -> tuple :
228 """
239 Get print format and letter head for a document based on PDF on Submit Settings.
2410
2511 Returns: (print_format, letter_head)
2612 """
27- if doctype not in ALLOWED_DOCTYPES :
28- frappe .throw (_ ("Print details not available for this document type" ))
29-
3013 if not frappe .has_permission (doctype , "print" , docname ):
3114 frappe .throw (_ ("No permission to print this document" ))
3215
You can’t perform that action at this time.
0 commit comments