fix: enabled default wharehouse field on service if STOCK_SUPPORTS_SERVICES (#28354)

This commit is contained in:
HENRY Florian 2024-02-22 13:24:18 +01:00 committed by GitHub
parent 9874d008aa
commit 38095cf8b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1486,7 +1486,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '</td></tr>';
}
if ($type != 1 && isModEnabled('stock')) {
if (($type != 1 || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) {
// Default warehouse
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"');
@ -2053,7 +2053,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Stock
if ($object->isProduct() && isModEnabled('stock')) {
if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) {
// Default warehouse
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"');
@ -2557,7 +2557,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Default warehouse
if ($object->isProduct() && isModEnabled('stock')) {
if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) {
$warehouse = new Entrepot($db);
$warehouse->fetch($object->fk_default_warehouse);