'Validate DocType before saving.
- Check if developer mode is set.
- Validate series
- Check fieldnames (duplication etc)
- Clear permission table for child tables
- Add `amended_from` and `amended_by` if Amendable'

def validate(self):

    self.check_developer_mode()
    self.validate_name()
    if self.issingle:
        self.allow_import = 0
        self.is_submittable = 0
        self.istable = 0
    elif self.istable:
        self.allow_import = 0
        self.permissions = []
    self.scrub_field_names()
    self.set_default_in_list_view()
    self.validate_series()
    self.validate_document_type()
    validate_fields(self)
    if self.istable:
        self.permissions = []
    else:
        validate_permissions(self)
    self.make_amendable()
    self.validate_website()
    if (not self.is_new()):
        self.before_update = frappe.get_doc(u'DocType', self.name)
    if (not self.is_new()):
        self.setup_fields_to_fetch()
    if (self.default_print_format and (not self.custom)):
        frappe.throw(_(u'Standard    DocType    cannot    have    default    print    format,    use    Customize    Form'))
