Bug when there is a calculated extrafield which use "dol_dir_list" for calculating the amount of files attached to a invoice
With bonus : the integer calculated extrafield configuration :
count(dol_dir_list($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').dol_sanitizeFileName($object->ref),'files',0,'','(\.meta|_preview.*\.png)$'));