Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0

This commit is contained in:
Laurent Destailleur 2022-02-16 20:27:26 +01:00
commit 906651d404
5 changed files with 12 additions and 7 deletions

View File

@ -41,3 +41,5 @@ QCFrequency=Quality control frequency (in days)
#Traceability - qc status #Traceability - qc status
OutOfOrder=Out of order OutOfOrder=Out of order
InWorkingOrder=In working order InWorkingOrder=In working order
CantMoveNonExistantSerial=Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.

View File

@ -42,3 +42,4 @@ HideLots=Masquer les lots
#Traceability - qc status #Traceability - qc status
OutOfOrder=Hors d'usage OutOfOrder=Hors d'usage
InWorkingOrder=En état de marche InWorkingOrder=En état de marche
CantMoveNonExistantSerial=Erreur : Vous avez demandé un mouvement sur un numéro de série qui n’existe plus. Peut-être avez-vous requis le même numéro de série plusieurs fois dans une même expédition, ou il a déjà servi dans une autre expédition. Supprimez cette expédition et préparez-en une autre.

View File

@ -944,7 +944,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
$delallowed = $usercancreate; $delallowed = $usercancreate;
$modulepart = 'stock'; $modulepart = 'stock';
print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object); print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
$somethingshown = $formfile->numoffiles; $somethingshown = $formfile->numoffiles;
print '</div><div class="fichehalfright"><div class="ficheaddleft">'; print '</div><div class="fichehalfright"><div class="ficheaddleft">';

View File

@ -842,7 +842,9 @@ class MouvementStock extends CommonObject
*/ */
private function createBatch($dluo, $qty) private function createBatch($dluo, $qty)
{ {
global $user; global $user, $langs;
$langs->load('productbatch');
$pdluo = new Productbatch($this->db); $pdluo = new Productbatch($this->db);
@ -853,7 +855,7 @@ class MouvementStock extends CommonObject
$result = $pdluo->fetch($dluo); $result = $pdluo->fetch($dluo);
if (empty($pdluo->id)) { if (empty($pdluo->id)) {
// We didn't find the line. May be it was deleted before by a previous move in same transaction. // We didn't find the line. May be it was deleted before by a previous move in same transaction.
$this->error = 'Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.'; $this->error = $langs->trans('CantMoveNonExistantSerial');
$this->errors[] = $this->error; $this->errors[] = $this->error;
$result = -2; $result = -2;
} }

View File

@ -391,7 +391,7 @@ foreach ($search as $key => $val) {
continue; continue;
} }
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if ($search[$key] != '') { if ($search[$key] != '' && !is_array($val)) {
$sql .= natural_search($key, $search[$key], $mode_search); $sql .= natural_search($key, $search[$key], $mode_search);
} }
} }
@ -609,9 +609,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit); $param .= '&limit='.urlencode($limit);
} }
foreach ($search as $key => $val) { foreach ($search as $key => $val) {
if (is_array($search[$key]) && count($search[$key])) { if (is_array($val) && count($val)) {
foreach ($search[$key] as $skey) { foreach ($val as $skey) {
$param .= '&search_'.$key.'[]='.urlencode($skey); $param .= (!empty($val)) ? '&search_'.$key.'[]='.urlencode($skey) : "";
} }
} else { } else {
$param .= '&search_'.$key.'='.urlencode($search[$key]); $param .= '&search_'.$key.'='.urlencode($search[$key]);