TypeError: datetime.date(2017, 7, 24) is not JSON serializable

Hi,
I am trying to get customers with this code

data = frappe.get_all("Customer", fields=["*"])
    return data

and all i get is this error:
TypeError: datetime.date(2017, 7, 24) is not JSON serializable

When I try to get the fields that does not contain Date it works successfully.
When I try on web with api/resource/Customer?fields=["*"]&limit_page_length=100
it still works fine.

Share your full code:

Try return frappe.as_json(data)

1 Like