diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php
index 4dddc5a8c80f4e1291f11634f86a86e6b7fa5fff..c171016506655a78584c80286a6c0003568d08d5 100644
--- a/dev/skeletons/skeleton_class.class.php
+++ b/dev/skeletons/skeleton_class.class.php
@@ -136,7 +136,7 @@ class Skeleton_Class extends CommonObject
      *
      *  @param	int		$id    	Id object
      *  @param	string	$ref	Ref
-     *  @return int          	<0 if KO, >0 if OK
+     *  @return int          	<0 if KO, 0 if not found, >0 if OK
      */
     function fetch($id,$ref='')
     {
@@ -154,7 +154,8 @@ class Skeleton_Class extends CommonObject
         $resql=$this->db->query($sql);
         if ($resql)
         {
-            if ($this->db->num_rows($resql))
+        	$numrows = $this->db->num_rows($resql);
+            if ($numrows)
             {
                 $obj = $this->db->fetch_object($resql);
 
@@ -165,7 +166,7 @@ class Skeleton_Class extends CommonObject
             }
             $this->db->free($resql);
 
-            return 1;
+            return ($numrows?1:0);
         }
         else
         {