Merge pull request #13798 from bb2a/patch-9

FIX Default warehouse is not select in search
This commit is contained in:
Laurent Destailleur 2020-05-03 21:15:38 +02:00 committed by GitHub
commit 3dab71199c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -254,8 +254,10 @@ class FormProduct
$out .= $comboenhancement;
}
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE;
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse;
if (strpos($htmlname, 'search_') !== 0) {
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE;
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse;
}
$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled' : '').' id="'.$htmlname.'" name="'.($htmlname.($disabled ? '_disabled' : '')).'">';
if ($empty) $out .= '<option value="-1">'.($empty_label ? $empty_label : '&nbsp;').'</option>';