'Throw exception if not developer mode or via patch'

def check_developer_mode(self):

    if (frappe.flags.in_patch or frappe.flags.in_test):
        return
    if ((not frappe.conf.get(u'developer_mode')) and (not self.custom)):
        frappe.throw(_(u"Not    in    Developer    Mode!    Set    in    site_config.json    or    make    'Custom'    DocType."))
