diff --git a/htdocs/product.class.php b/htdocs/product.class.php index 389d2febaf2..e2568a7a3ae 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -1673,7 +1673,7 @@ class Product extends CommonObject * \param user Utilisateur qui fait le lien * \param id_fourn Id du fournisseur * \param ref_fourn Reference chez le fournisseur - * \return int < 0 si erreur, > 0 si ok + * \return int < 0 if KO, 0 if link already exists, > 0 if OK */ function add_fournisseur($user, $id_fourn, $ref_fourn) { @@ -1737,8 +1737,9 @@ class Product extends CommonObject $obj = $this->db->fetch_object($resql); $this->product_fourn_id = $obj->rowid; } + + return 0; } - $this->db->free($resql); } else { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index f1c034c5f1b..b31772ffd23 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -115,7 +115,15 @@ if ($_POST["action"] == 'updateprice' && $_POST["cancel"] <> $langs->trans("Canc $error++; $mesg='