def new_doc(doctype, parent_doc=None, parentfield=None, as_dict=False):
 from frappe.model.create_new import get_new_doc
 return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)

def new_doc ( doctype , parent_doc = None , parentfield = None , as_dict = False ) : from frappe . model . create_new import get_new_doc return get_new_doc ( doctype , parent_doc , parentfield , as_dict = as_dict )
returns a new document of the given doctype with defaults set .