Fix error message

This commit is contained in:
Laurent Destailleur 2020-11-27 16:13:27 +01:00
parent 4a5cdd0092
commit 5ed2bbb204
2 changed files with 5 additions and 9 deletions

View File

@ -435,16 +435,11 @@ if (empty($reshook))
$result = $object->valid($user);
if ($result < 0)
{
$langs->load("errors");
setEventMessages($langs->trans($object->error), $object->errors, 'errors');
}
else
{
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
// Define output language
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');

View File

@ -204,6 +204,7 @@ class MouvementStock extends CommonObject
{
if (empty($batch))
{
$langs->load("errors");
$this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref);
dol_syslog("Try to make a movement of a product with status_batch on without any batch data");