code: def editableFields(self, instance, visible_only=False):
      
      ret = []
      portal = getToolByName(instance, 'portal_url').getPortalObject()
      for field in self.fields():
          if field.writeable(instance, debug=False) and    \
                 (not visible_only or
                  field.widget.isVisible(
                      instance, mode='edit', field=field) != 'invisible') and \
                  field.widget.testCondition(instance.aq_parent, portal, instance):
              ret.append(field)
      return ret
docs: Returns a list of editable fields for the given instance