alter view vBluesealProductSlimList as
SELECT
`p`.`id`                                       AS `id`,
  `p`.`productVariantId`                         AS `productVariantId`,
  concat(`p`.`id`, '-', `p`.`productVariantId`)  AS `code`,
  `pb`.`name`                                    AS `brand`,
   concat(`p`.`itemno`, ' # ', `pv`.`name`)       AS `cpf`,
  `shp`.`extId`                                  AS `externalId`,
  concat(`ps`.`name`, ' ', `ps`.`year`)          AS `season`,
  `s`.`id`                                       AS `shopId`,
  `s`.`title`                                    AS `shop`,
  if((`p`.`qty` > 0), 'disponibile', 'mancante') AS `stock`,
  `p`.`creationDate`                             AS `creationDate`,
  `pss`.`name`                                   AS `status`,
  if(count(psa.productDetailId) > 0, 'si', 'no') as details
FROM ((((((`Product` `p`
  JOIN `ProductVariant` `pv`)
  JOIN `ProductBrand` `pb`)
  JOIN `ProductStatus` `pss`)
  LEFT JOIN `ProductSeason` `ps` on `p`.`productSeasonId` = `ps`.`id`)
  LEFT JOIN `ShopHasProduct` `shp` on `p`.`productVariantId` = `shp`.`productVariantId`)
  JOIN `Shop` `s`)
  LEFT JOIN ProductSheetActual psa on p.id = psa.productId and p.productVariantId = psa.productVariantId
WHERE (
  (`p`.`productVariantId` = `pv`.`id`) AND (`p`.`productBrandId` = `pb`.`id`) AND (`p`.`id` = `shp`.`productId`) AND
  (`s`.`id` = `shp`.`shopId`) AND
   (`pss`.`id` = `p`.`productStatusId`) AND (`pss`.`id` NOT IN (7, 8)))
GROUP BY `p`.`id`, `p`.`productVariantId`, `s`.`id`
ORDER BY `p`.`creationDate` DESC