Apologies for the long delay in getting back to you. So here’s a sample SQL query that is used to pull data for the inventory browser page. This won’t work on your server because the IDs are specific to my local database.
SELECT productava0_.product_id AS col_0_0_,
Sum(productava0_.quantity_on_hand) AS col_1_0_,
product1_.id AS id44_,
product1_.version AS version44_,
product1_.abc_class AS abc3_44_,
product1_.active AS active44_,
product1_.brand_name AS brand5_44_,
product1_.category_id AS category6_44_,
product1_.cold_chain AS cold7_44_,
product1_.controlled_substance AS controlled8_44_,
product1_.cost_per_unit AS cost9_44_,
product1_.created_by_id AS created10_44_,
product1_.date_created AS date11_44_,
product1_.default_uom_id AS default12_44_,
product1_.description AS descrip13_44_,
product1_.essential AS essential44_,
product1_.gl_account_id AS gl15_44_,
product1_.hazardous_material AS hazardous16_44_,
product1_.last_updated AS last17_44_,
product1_.lot_and_expiry_control AS lot18_44_,
product1_.lot_control AS lot19_44_,
product1_.manufacturer AS manufac20_44_,
product1_.manufacturer_code AS manufac21_44_,
product1_.manufacturer_name AS manufac22_44_,
product1_.model_number AS model23_44_,
product1_.NAME AS name44_,
product1_.ndc AS ndc44_,
product1_.package_size AS package26_44_,
product1_.price_per_unit AS price27_44_,
product1_.product_code AS product28_44_,
product1_.product_type_id AS product29_44_,
product1_.reconditioned AS recondi30_44_,
product1_.serialized AS serialized44_,
product1_.unit_of_measure AS unit32_44_,
product1_.upc AS upc44_,
product1_.updated_by_id AS updated34_44_,
product1_.vendor AS vendor44_,
product1_.vendor_code AS vendor36_44_,
product1_.vendor_name AS vendor37_44_,
(SELECT Max(pc.color)
FROM product_catalog_item pci
LEFT OUTER JOIN product_catalog pc
ON pci.product_catalog_id = pc.id
WHERE pci.product_id = product1_.id
GROUP BY pci.product_id) AS formula1_
FROM product_availability productava0_
INNER JOIN product product1_ ON productava0_.product_id = product1_.id
WHERE productava0_.location_id = '1'
AND ( productava0_.product_id IN (
'ff80818179f420480179f42ccb010006',
'ff80818179f420480179f42ccb550007',
'ff80818179f420480179f42ccb820008',
'ff80818179f420480179f42ccbad0009',
'ff80818179f420480179f42ccbce000a',
'ff80818179f420480179f42ccbf3000b',
'ff80818179f420480179f42ccc17000c',
'ff80818179f420480179f42ccc37000d',
'ff80818179f420480179f42ccc66000e',
'ff80818179f420480179f42ccc82000f' ) )
GROUP BY productava0_.product_id
But looking at the SQL, the only way I can see a duplicate row being returned is if the product_availability table had duplicate rows.
Therefore, could you check the product availability table to see if you have any duplicates?