@frappe.whitelist()
def make_default(name):
 frappe.has_permission(u'Print Format', u'write')
 print_format = frappe.get_doc(u'Print Format', name)
 if ((frappe.conf.get(u'developer_mode') or 0) == 1):
  doctype = frappe.get_doc(u'DocType', print_format.doc_type)
  doctype.default_print_format = name
  doctype.save()
 else:
  frappe.make_property_setter({u'doctype_or_field': u'DocType', u'doctype': print_format.doc_type, u'property': u'default_print_format', u'value': name})
 frappe.msgprint(frappe._(u'Done'))

@ frappe . whitelist ( ) def make_default ( name ) : frappe . has_permission ( u'Print Format' , u'write' ) print_format = frappe . get_doc ( u'Print Format' , name ) if ( ( frappe . conf . get ( u'developer_mode' ) or 0 ) == 1 ) : doctype = frappe . get_doc ( u'DocType' , print_format . doc_type ) doctype . default_print_format = name doctype . save ( ) else : frappe . make_property_setter ( { u'doctype_or_field' : u'DocType' , u'doctype' : print_format . doc_type , u'property' : u'default_print_format' , u'value' : name } ) frappe . msgprint ( frappe . _ ( u'Done' ) )
set print format as default .