'If the user does not have permissions at permlevel > 0, then reset the values to original / default'

def reset_values_if_no_permlevel_access(self, has_access_to, high_permlevel_fields):

    to_reset = []
    for df in high_permlevel_fields:
        if ((df.permlevel not in has_access_to) and (df.fieldtype not in display_fieldtypes)):
            to_reset.append(df)
    if to_reset:
        if self.is_new():
            ref_doc = frappe.new_doc(self.doctype)
        elif self.parent:
            self.parent_doc.get_latest()
            ref_doc = [d for d in self.parent_doc.get(self.parentfield) if (d.name == self.name)][0]
        else:
            ref_doc = self.get_latest()
        for df in to_reset:
            self.set(df.fieldname, ref_doc.get(df.fieldname))
