From 619bcb44df5bd39bc0af4aeab58b7a51d9465336 Mon Sep 17 00:00:00 2001 From: jean Date: Tue, 21 Oct 2014 19:02:48 +0200 Subject: [PATCH] object must be reloaded before creating pdf on confirmation and ordering --- htdocs/fourn/commande/fiche.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 00884d368f6..3c1d15ddc47 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -523,7 +523,8 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou if ($result > 0) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + $ret=$object->fetch($object->id); // Reload to get new records + supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; @@ -555,7 +556,8 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo if ($result > 0) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + $ret=$object->fetch($object->id); // Reload to get new records + supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit;