diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index d6495ce24fde0a49ea38360b2a1a33a7e7e9ffa6..b63dbdc9dbb7ee692187971c80157fe653e9ecf1 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1022,7 +1022,7 @@ class Product extends CommonObject
 		if ($id) $sql.= " WHERE rowid = '".$id."'";
 		else
 		{
-			$sql.= " WHERE p.entity IN (".getEntity($this->element, 1).")";
+			$sql.= " WHERE entity IN (".getEntity($this->element, 1).")";
 			if ($ref) $sql.= " AND ref = '".$this->db->escape($ref)."'";
 			else if ($ref_ext) $sql.= " AND ref_ext = '".$this->db->escape($ref_ext)."'";
 		}