diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index eb927756263..40181167baa 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -164,14 +164,14 @@ if (ismodEnabled('productbatch') &&
print '
'.$langs->trans("SellByDate").' | ';
$sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
// If form was opened for a specific pdluoid, field is disabled
- print $form->selectDate((!empty($sellbyselected) ? $sellbyselected : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
+ print $form->selectDate(($pdluo->id > 0 ? $pdluo->sellby : $sellbyselected), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
print ' | ';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print ''.$langs->trans("EatByDate").' | ';
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
// If form was opened for a specific pdluoid, field is disabled
- print $form->selectDate((!empty($eatbyselected) ? $eatbyselected : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
+ print $form->selectDate(($pdluo->id > 0 ? $pdluo->eatby : $eatbyselected), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0));
print ' | ';
}
print '';