diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index b9c81f699eab39b392590cab5bb33a03aaf86bfe..bb47ec80fe868b4ab29c7955317b6afbe591571c 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -439,21 +439,10 @@ class Project extends CommonObject
             if ($conf->projet->dir_output)
             {
                 $dir = $conf->projet->dir_output . "/" . $projectref;
-                $file = $conf->projet->dir_output . "/" . $projectref . "/" . $projectref . ".pdf";
-                if (file_exists($file))
-                {
-                    dol_delete_preview($this);
-
-                    if (!dol_delete_file($file))
-                    {
-                        $this->error = 'ErrorFailToDeleteFile';
-                        $this->db->rollback();
-                        return 0;
-                    }
-                }
+                
                 if (file_exists($dir))
                 {
-                    $res = @dol_delete_dir($dir);
+                    $res = @dol_delete_dir_recursive($dir);
                     if (!$res)
                     {
                         $this->error = 'ErrorFailToDeleteDir';