FIX : manage error

This commit is contained in:
atm-quentin 2018-10-22 16:49:36 +02:00
parent 5b69357233
commit 0a033f4cfd
2 changed files with 4 additions and 2 deletions

View File

@ -61,6 +61,7 @@ NoProductToShipFoundIntoStock=Aucun produit à expédier n'a été trouver dans
WeightVolShort=Poids/vol.
ValidateOrderFirstBeforeReception=Vous devez d'abord valider la commande pour pouvoir créer une réception.
CreateInvoiceForThisSupplier=Facturer réceptions
ErrorRefAlreadyExists = La référence fournisseur existe déjà
# Reception methods
# ModelDocument

View File

@ -181,7 +181,8 @@ if (empty($reshook))
$object = new FactureFournisseur($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])){
$object = $TFactThird[$rcp->socid]; // If option "one bill per third" is set, we use already created reception.
$object->fetchObjectLinked();
if(empty($object->rowid)&&$object->id != null)$object->rowid = $object->id;
if(!empty($object->rowid))$object->fetchObjectLinked();
$rcp->fetchObjectLinked();
if (count($rcp->linkedObjectsIds['order_supplier']) > 0)
@ -234,7 +235,7 @@ if (empty($reshook))
$nb_bills_created++;
$object->id = $res;
}else {
$errors[]=$object->error;
$errors[]=$rcp->ref.' : '.$langs->trans($object->error);
$error++;
}
}