From 19f3866b054603f86eb29faf09688143b62e2d78 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 29 Nov 2012 01:05:45 +0100 Subject: [PATCH] Fix : have to fetch object after create to reload values + thirdparty must be loaded if mode = create --- htdocs/fourn/commande/fiche.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index bdd14490d64..4b21dc14ce6 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -83,8 +83,13 @@ if ($id > 0 || ! empty($ref)) { $resObj = $object->fetch($id, $ref); $resTP = $object->fetch_thirdparty(); + print_r($object->thirdparty); if ($resObj < 0) dol_print_error($db,$object->error); if ($resTP < 0) dol_print_error($db,$object->error); +} else if($socid) { + $object->socid = $socid; + $resTP = $object->fetch_thirdparty(); + if ($resTP < 0) dol_print_error($db,$object->error); } /* @@ -334,9 +339,6 @@ else if ($action == 'updateligne' && $user->rights->fournisseur->commande->creer if ($product->fetch($_POST["elrowid"]) < 0) dol_print_error($db); } - if ($resObj < 0) dol_print_error($db,$object->error); - if ($resTP < 0) dol_print_error($db,$object->error); - $localtax1_tx=get_localtax($_POST['tva_tx'],1,$object->thirdparty); $localtax2_tx=get_localtax($_POST['tva_tx'],2,$object->thirdparty); @@ -684,6 +686,7 @@ else if ($action == 'create' && $user->rights->fournisseur->commande->creer) } $id=$orderid; + $ret=$object->fetch($id); // Reload to get new records $db->commit(); }