Fix: Regression

This commit is contained in:
Laurent Destailleur 2012-08-26 14:14:27 +02:00
parent 1c0303ea6b
commit 7db8c8aab9

View File

@ -49,6 +49,8 @@ $langs->load('products');
if (! empty($conf->margin->enabled)) if (! empty($conf->margin->enabled))
$langs->load('margins'); $langs->load('margins');
$error=0;
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$ref=GETPOST('ref','alpha'); $ref=GETPOST('ref','alpha');
$socid=GETPOST('socid','int'); $socid=GETPOST('socid','int');
@ -73,6 +75,8 @@ $object = new Propal($db);
// Load object // Load object
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
if ($action != 'add')
{
$ret=$object->fetch($id, $ref); $ret=$object->fetch($id, $ref);
if ($ret == 0) if ($ret == 0)
{ {
@ -85,10 +89,8 @@ if ($id > 0 || ! empty($ref))
setEventMessage($object->error, 'errors'); setEventMessage($object->error, 'errors');
$error++; $error++;
} }
} else $object->fetch_thirdparty();
if (! $error) }
{
$object->fetch_thirdparty();
} }
else else
{ {