code: def get_fields_with_visibility(self, visibility, mode="add"):
          
          ar = self.get_ar()
          mv = api.get_view("ar_add_manage", context=ar)
          mv.get_field_order()
  
          out = []
          for field in mv.get_fields_with_visibility(visibility, mode):
              # check custom field condition
              visible = self.is_field_visible(field)
              if visible is False and visibility != "hidden":
                  continue
              out.append(field)
          return out
docs: Return the AR fields with the current visibility