set errors from object

This commit is contained in:
Frédéric FRANCE 2023-02-24 16:57:39 +01:00
parent e4e472b4ff
commit 652a215a07
7 changed files with 9 additions and 18 deletions

View File

@ -1505,8 +1505,7 @@ class Propal extends CommonObject
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}
}

View File

@ -1279,8 +1279,7 @@ class Commande extends CommonOrder
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}
}
@ -1436,8 +1435,7 @@ class Commande extends CommonOrder
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}

View File

@ -1330,8 +1330,7 @@ class Facture extends CommonInvoice
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}
}
@ -1465,8 +1464,7 @@ class Facture extends CommonInvoice
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}

View File

@ -2630,8 +2630,7 @@ class Contrat extends CommonObject
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $clonedObj, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}
}

View File

@ -512,8 +512,7 @@ class ExpenseReport extends CommonObject
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}
}

View File

@ -1249,8 +1249,7 @@ class Fichinter extends CommonObject
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}
}

View File

@ -1758,8 +1758,7 @@ class CommandeFournisseur extends CommonOrder
$action = '';
$reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->errors += $hookmanager->errors;
$this->error = $hookmanager->error;
$this->setErrorsFromObject($hookmanager);
$error++;
}
}