Fetch select field from python method

hello, I created this python method that returns a list of some fields . and doctype with a select type field . I want this field to fetch data from that python method. anyone can help ?

1 Like

Perhaps if you could share your code, someone could make suggestion.

@smino
it’s a function that returns the field’s names as a list, for exemple for sales invoice it returns [“name”,“grand_total”,…]
in teh select field I want the user to see the doctype fields and select one .

def get_fields(doctype):                                                                                                                                                                                                   
    fields = frappe.get_doc("DocType",doctype).fields                                                                                                                                                                  
    r=[]                                                                                                                                                                                                               
    for f in fields :
                if f.label!= None and f.fieldtype not in ["Table","Section Break","Column Break"]:
                        r.append(f.fieldname)
    return(r)
1 Like