SELECT count(*) AS "count", CAST("public"."product_product"."create_date" AS date) AS "create_date" FROM "public"."product_product" LEFT JOIN "public"."product_template" "product_template__via__product" ON "public"."product_product"."product_tmpl_id" = "product_template__via__product"."id" WHERE ("public"."product_product"."active" = TRUE AND "product_template__via__product"."sale_ok" = TRUE) GROUP BY CAST("public"."product_product"."create_date" AS date) ORDER BY CAST("public"."product_product"."create_date" AS date) ASC