diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index 79d33b1d884..49b700b46ca 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -193,16 +193,19 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all')
//print '
';
// Generation des graphs
- $dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]);
- if (! file_exists($dir.'/'.$object->id))
+ if ($object->id > 0) // We are on statistics for a dedicated product
{
- if (dol_mkdir($dir.'/'.$object->id) < 0)
- {
- $mesg = $langs->trans("ErrorCanNotCreateDir",$dir);
- $error++;
- }
+ $dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]);
+ if (! file_exists($dir.'/'.$object->id))
+ {
+ if (dol_mkdir($dir.'/'.$object->id) < 0)
+ {
+ $mesg = $langs->trans("ErrorCanNotCreateDir",$dir);
+ $error++;
+ }
+ }
}
-
+
$graphfiles=array(
'propal' =>array('modulepart'=>'productstats_proposals',
'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png',