You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 line
801 B

  1. # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
  2. # MIT License. See license.txt
  3. from __future__ import unicode_literals
  4. import frappe
  5. def execute():
  6. frappe.reload_doc("core", "doctype", "print_settings")
  7. print_settings = frappe.get_doc("Print Settings")
  8. print_settings.print_style = "Modern"
  9. try:
  10. import pdfkit
  11. except ImportError:
  12. pass
  13. else:
  14. # if someone has already configured in Outgoing Email Settings
  15. # outgoing_email_settings = frappe.db.get_singles_dict("Outgoing Email Settings")
  16. # if "send_print_as_pdf" in outgoing_email_settings:
  17. # print_settings.send_print_as_pdf = outgoing_email_settings.send_print_as_pdf
  18. # print_settings.pdf_page_size = outgoing_email_settings.pdf_page_size
  19. print_settings.send_print_as_pdf = 1
  20. print_settings.save()