Original query:

SELECT 
"pi"."titulo",  
"pa"."stock_disponible" - "pa"."stock_comprometido" AS xxx, 
"p"."cod_producto",   
"pa"."stock_disponible", 
"pa"."stock_comprometido", 
"pa"."stock_solicidato",  
(SELECT "pa2"."stock_disponible" FROM "productos_almacen" pa2 WHERE "pa2"."cod_producto" = "p"."cod_producto" AND "pa2"."cod_almacen" = 18) AS stock_disponible_exercycle,   
"ps"."w1" AS weekly_sales, 
"ps"."m1" AS montly_sales, 
"ps"."h1" AS six_monthly_sales, 
"ps"."y1" AS yearly_sales, 
"m"."marca", 
"c"."categoria" ,
psi18n.physical_state, 
ec.estado_comercial
FROM 
"productos" p 
JOIN "marcas" m ON ("p"."cod_marca" = "m"."cod_marca") 
JOIN "categorias" c ON ("c"."cod_categoria" = "p"."cod_categoria") JOIN "prod_stats" ps ON ("p"."cod_producto" = "ps"."cod_producto") 
JOIN "productos_almacen" pa ON "p"."cod_producto" = "pa"."cod_producto" AND "pa"."cod_almacen" = 1 
JOIN "prod_grup_gp_basic" pggb ON "p"."cod_producto" = "pggb"."cod_producto" AND "pggb"."cod_grupo_prod_basic" = 1 
JOIN "prod_bid_type" pbt ON ("pbt"."cod_prod_bid_type" = "pggb"."cod_prod_bid_type") JOIN "productos_grupo_tarifas" pgt ON "pgt"."cod_producto" = "p"."cod_producto" AND "pgt"."cod_grupo_tarifas" = 1 
JOIN "productos_idiomas" pi ON "pi"."cod_producto" = "p"."cod_producto" AND "pi"."cod_idioma" = 'es' 
JOIN "productos_grupo_importancias" pgi ON "pgi"."cod_producto" = "p"."cod_producto" AND "pgi"."cod_grupo_importancias" = 1
JOIN "prod_physical_state_i18n" psi18n ON (psi18n.cod_physical_state=pggb.cod_physical_state AND psi18n.cod_idioma = 'es' )
JOIN estados_comerciales ec ON (ec.cod_estado_comercial=p.cod_estado_comercial)
-- cod_grupo_prod_basic 
WHERE 
"cod_prod_role" IN (1, 3) AND 
"pggb"."cod_physical_state" <> 3 AND 
"p"."cod_producto" IN (10000225, 10000237, 10000238, 10000240, 10000241, 10000242, 10000305, 10000346, 10000500, 10000508, 10000548, 10000569, 10000586, 10000623, 10000683, 10000699, 10000726, 10000728, 10000730, 10000774, 10000825, 10000832, 10000871, 10000890, 10000896, 10000918, 10000921, 10000929, 10000930, 10000931, 10000936, 10000944, 10000945, 10000993, 10001059, 10001078, 10001081, 10001110, 10001145, 10001146, 10001175, 10001212, 10001325, 10001332, 10001362, 10001428, 10001465, 10001466, 10001635, 10001636, 10001637, 10001639, 10001640, 10001642, 10001644, 10001645, 10001646, 10001647, 10001649, 10001651, 10001652, 10001654, 10001655, 10001659, 10001661, 10001663, 10001664, 10001665, 10001666, 10001668, 10001674, 10001675, 10001678, 10001681, 10001682, 10001683, 10001684, 10001685, 10001686, 10001687, 10001688, 10001689, 10001690, 10001692, 10001796, 10001868, 10001886, 10001890, 10001943, 10002002, 10002094, 10002096, 10002097, 10002128, 10002309, 10002361, 10002364, 10002367, 10002368, 10002371, 10002372, 10002374, 10002470, 10002550, 10002604, 10002608, 10002613, 10002615, 10002718, 10002743, 10002747, 10002748, 10002749, 10002754, 10002761, 10002785, 10002814, 10002815, 10002816, 10002817, 10002818, 10002821, 10002858, 10002859, 10002860, 10002861, 10002881, 10002882, 10002884, 10002886, 10002957, 10003140, 10003227, 10003377, 10003496, 10003624, 10004035, 10004083, 10004236, 10004301, 10004401, 10004413, 10004462, 10004834, 10005003, 10005057, 10005094, 10005096, 10005152, 10005354, 10005355, 10005356, 10005360, 10005361, 10005362, 10005365, 10005369, 10005370, 10005380, 10005381, 10005704, 10005713, 10005725, 10005727, 10005728, 10005729, 10005730, 10005731, 10005732, 10005750, 10005827, 10005877, 10005934, 10005949, 10005982, 10006028, 10006052, 10006054, 10006055, 10006064, 10006065, 10006066, 10006067, 10006068, 10006069, 10006073, 10006101, 10006263, 10006299, 10006327, 10006447, 10006451, 10006452, 10006475, 10006722, 10006730, 10006774, 10006785, 10006797, 10006798, 10006799, 10006800, 10006806, 10006930, 10007016, 10007089, 10007090, 10007219, 10007224, 10007225, 10007226, 10007227, 10007244, 10007358, 10007385, 10007544, 10007594, 10007649, 10007852, 10007937, 10008071, 10008072, 10008073, 10008090, 10008100, 10008319, 10008692, 10008693, 10008712, 10008720, 10008721, 10008725, 10008726, 10008727, 10008728, 10008729, 10008730, 10008731, 10008803, 10008805, 10008810, 10008832, 10008834, 10008850, 10008952, 10008993, 10009088, 10009089, 10009090, 10009263, 10009264, 10009266, 10009267, 10009268, 10009269, 10009276, 10009277, 10009281, 10009283, 10009293, 10009665, 10009730, 10009740, 10009838, 10009841, 10009842, 10009843, 10009844, 10009937, 10009939, 10009941, 10009944, 10009946, 10009947, 10009950, 10009978, 10009997, 10009998, 10010165, 10010167, 10010172, 10010173, 10010178, 10010186, 10010190, 10010191, 10010195, 10010199, 10010207, 10010258, 10010259, 10010382, 10010383, 10010384, 10010393, 10010394, 10010395, 10010396, 10010397, 10010398, 10010399, 10010400, 10010401, 10010444, 10010445, 10010588, 10010589, 10010617, 10010826, 10010878, 10010938, 10011013, 10011507, 10011564, 10011566, 10011712, 10011713, 10011714, 10011715, 10011716, 10011718, 10011719, 10011720, 10011723, 10011724, 10011726, 10011727, 10011728, 10011730, 10011731, 10011732, 10011733, 10011736, 10011737, 10011738, 10011739, 10011743, 10011830, 10011831, 10011832, 10011833, 10011834, 10011835, 10011836, 10012089, 10012268, 10012347, 10012348, 10012349, 10012377, 10012378, 10012379, 10012380, 10012382, 10012383, 10012404, 10012405, 10012528, 10012545, 10012547, 10012624, 10012755, 10012756, 10012776, 10012777, 10012778, 10012796, 10012920, 10013072, 10013283, 10013284, 10013286, 10013288, 10013289, 10013290, 10013396, 10013398, 10013399, 10013401, 10013402, 10013403, 10013404, 10013406, 10013407, 10013408, 10013410, 10013411, 10013701, 10013754, 10013755, 10013756, 10013757, 10013758, 10013759, 10013760, 10013761, 10013762, 10013763, 10013774, 10013778, 10013780, 10013836, 10014091, 10014092, 10014093, 10014095, 10014096, 10014098, 10014165, 10014227, 10014228, 10014229, 10014230, 10014580, 10014598, 10014617, 10014657, 10014745, 10014780, 10014795, 10014796, 10015112, 10015113, 10015114, 10015115, 10015116, 10015117, 10015118, 10015205, 10015206, 10015363, 10015465, 10015539, 10012381, 10014094, 10013295, 10013296, 10013297, 10013298, 10013299, 10013300, 10013301, 10013348, 10013350, 10013316, 10013317, 10013318, 10013319, 10013330, 10013333, 10013335, 10013336, 10013391, 10013392, 10013394, 10013395, 10015771, 10015772, 10015773, 10015774) 
ORDER BY "p"."cod_producto" 

Prettified:

SELECT
  "pi"."titulo",
  "pa"."stock_disponible" - "pa"."stock_comprometido" AS xxx,
  "p"."cod_producto",
  "pa"."stock_disponible",
  "pa"."stock_comprometido",
  "pa"."stock_solicidato",
  (SELECT "pa2"."stock_disponible" FROM "productos_almacen" pa2 WHERE "pa2"."cod_producto" = "p"."cod_producto" AND "pa2"."cod_almacen" = 18) AS stock_disponible_exercycle,
  "ps"."w1" AS weekly_sales,
  "ps"."m1" AS montly_sales,
  "ps"."h1" AS six_monthly_sales,
  "ps"."y1" AS yearly_sales,
  "m"."marca",
  "c"."categoria",
  "psi18n"."physical_state",
  "ec"."estado_comercial"
FROM
  "productos" p
  JOIN "marcas" m ON ("p"."cod_marca" = "m"."cod_marca")
  JOIN "categorias" c ON ("c"."cod_categoria" = "p"."cod_categoria")
  JOIN "prod_stats" ps ON ("p"."cod_producto" = "ps"."cod_producto")
  JOIN "productos_almacen" pa ON "p"."cod_producto" = "pa"."cod_producto" AND
                                 "pa"."cod_almacen" = 1
  JOIN "prod_grup_gp_basic" pggb ON "p"."cod_producto" = "pggb"."cod_producto" AND
                                    "pggb"."cod_grupo_prod_basic" = 1
  JOIN "prod_bid_type" pbt ON ("pbt"."cod_prod_bid_type" = "pggb"."cod_prod_bid_type")
  JOIN "productos_grupo_tarifas" pgt ON "pgt"."cod_producto" = "p"."cod_producto" AND
                                        "pgt"."cod_grupo_tarifas" = 1
  JOIN "productos_idiomas" pi ON "pi"."cod_producto" = "p"."cod_producto" AND
                                 "pi"."cod_idioma" = 'es'
  JOIN "productos_grupo_importancias" pgi ON "pgi"."cod_producto" = "p"."cod_producto" AND
                                             "pgi"."cod_grupo_importancias" = 1
  JOIN "prod_physical_state_i18n" psi18n ON "psi18n"."cod_physical_state" = "pggb"."cod_physical_state" AND
                                            "psi18n"."cod_idioma" = 'es'
  JOIN "estados_comerciales" ec ON ("ec"."cod_estado_comercial" = "p"."cod_estado_comercial")
WHERE
  "cod_prod_role" IN (1, 3) AND
  "pggb"."cod_physical_state" <> 3 AND
  "p"."cod_producto" IN (10000225, 10000237, 10000238, 10000240, 10000241, 10000242, 10000305, 10000346, 10000500, 10000508, 10000548, 10000569, 10000586, 10000623, 10000683, 10000699, 10000726, 10000728, 10000730, 10000774, 10000825, 10000832, 10000871, 10000890, 10000896, 10000918, 10000921, 10000929, 10000930, 10000931, 10000936, 10000944, 10000945, 10000993, 10001059, 10001078, 10001081, 10001110, 10001145, 10001146, 10001175, 10001212, 10001325, 10001332, 10001362, 10001428, 10001465, 10001466, 10001635, 10001636, 10001637, 10001639, 10001640, 10001642, 10001644, 10001645, 10001646, 10001647, 10001649, 10001651, 10001652, 10001654, 10001655, 10001659, 10001661, 10001663, 10001664, 10001665, 10001666, 10001668, 10001674, 10001675, 10001678, 10001681, 10001682, 10001683, 10001684, 10001685, 10001686, 10001687, 10001688, 10001689, 10001690, 10001692, 10001796, 10001868, 10001886, 10001890, 10001943, 10002002, 10002094, 10002096, 10002097, 10002128, 10002309, 10002361, 10002364, 10002367, 10002368, 10002371, 10002372, 10002374, 10002470, 10002550, 10002604, 10002608, 10002613, 10002615, 10002718, 10002743, 10002747, 10002748, 10002749, 10002754, 10002761, 10002785, 10002814, 10002815, 10002816, 10002817, 10002818, 10002821, 10002858, 10002859, 10002860, 10002861, 10002881, 10002882, 10002884, 10002886, 10002957, 10003140, 10003227, 10003377, 10003496, 10003624, 10004035, 10004083, 10004236, 10004301, 10004401, 10004413, 10004462, 10004834, 10005003, 10005057, 10005094, 10005096, 10005152, 10005354, 10005355, 10005356, 10005360, 10005361, 10005362, 10005365, 10005369, 10005370, 10005380, 10005381, 10005704, 10005713, 10005725, 10005727, 10005728, 10005729, 10005730, 10005731, 10005732, 10005750, 10005827, 10005877, 10005934, 10005949, 10005982, 10006028, 10006052, 10006054, 10006055, 10006064, 10006065, 10006066, 10006067, 10006068, 10006069, 10006073, 10006101, 10006263, 10006299, 10006327, 10006447, 10006451, 10006452, 10006475, 10006722, 10006730, 10006774, 10006785, 10006797, 10006798, 10006799, 10006800, 10006806, 10006930, 10007016, 10007089, 10007090, 10007219, 10007224, 10007225, 10007226, 10007227, 10007244, 10007358, 10007385, 10007544, 10007594, 10007649, 10007852, 10007937, 10008071, 10008072, 10008073, 10008090, 10008100, 10008319, 10008692, 10008693, 10008712, 10008720, 10008721, 10008725, 10008726, 10008727, 10008728, 10008729, 10008730, 10008731, 10008803, 10008805, 10008810, 10008832, 10008834, 10008850, 10008952, 10008993, 10009088, 10009089, 10009090, 10009263, 10009264, 10009266, 10009267, 10009268, 10009269, 10009276, 10009277, 10009281, 10009283, 10009293, 10009665, 10009730, 10009740, 10009838, 10009841, 10009842, 10009843, 10009844, 10009937, 10009939, 10009941, 10009944, 10009946, 10009947, 10009950, 10009978, 10009997, 10009998, 10010165, 10010167, 10010172, 10010173, 10010178, 10010186, 10010190, 10010191, 10010195, 10010199, 10010207, 10010258, 10010259, 10010382, 10010383, 10010384, 10010393, 10010394, 10010395, 10010396, 10010397, 10010398, 10010399, 10010400, 10010401, 10010444, 10010445, 10010588, 10010589, 10010617, 10010826, 10010878, 10010938, 10011013, 10011507, 10011564, 10011566, 10011712, 10011713, 10011714, 10011715, 10011716, 10011718, 10011719, 10011720, 10011723, 10011724, 10011726, 10011727, 10011728, 10011730, 10011731, 10011732, 10011733, 10011736, 10011737, 10011738, 10011739, 10011743, 10011830, 10011831, 10011832, 10011833, 10011834, 10011835, 10011836, 10012089, 10012268, 10012347, 10012348, 10012349, 10012377, 10012378, 10012379, 10012380, 10012382, 10012383, 10012404, 10012405, 10012528, 10012545, 10012547, 10012624, 10012755, 10012756, 10012776, 10012777, 10012778, 10012796, 10012920, 10013072, 10013283, 10013284, 10013286, 10013288, 10013289, 10013290, 10013396, 10013398, 10013399, 10013401, 10013402, 10013403, 10013404, 10013406, 10013407, 10013408, 10013410, 10013411, 10013701, 10013754, 10013755, 10013756, 10013757, 10013758, 10013759, 10013760, 10013761, 10013762, 10013763, 10013774, 10013778, 10013780, 10013836, 10014091, 10014092, 10014093, 10014095, 10014096, 10014098, 10014165, 10014227, 10014228, 10014229, 10014230, 10014580, 10014598, 10014617, 10014657, 10014745, 10014780, 10014795, 10014796, 10015112, 10015113, 10015114, 10015115, 10015116, 10015117, 10015118, 10015205, 10015206, 10015363, 10015465, 10015539, 10012381, 10014094, 10013295, 10013296, 10013297, 10013298, 10013299, 10013300, 10013301, 10013348, 10013350, 10013316, 10013317, 10013318, 10013319, 10013330, 10013333, 10013335, 10013336, 10013391, 10013392, 10013394, 10013395, 10015771, 10015772, 10015773, 10015774)
ORDER BY
  "p"."cod_producto"