From 312f11d7b3fae7a79265215f6b0ec45899fcee8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Jan 2021 10:30:11 +0100 Subject: [PATCH] Update objectline_edit.tpl.php --- htdocs/core/tpl/objectline_edit.tpl.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 88dfa07e028..d524fe22bf8 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -189,15 +189,14 @@ $coldisplay++; global->PRODUCT_USE_UNITS)) - { + if (!empty($conf->global->PRODUCT_USE_UNITS)) { $unit_type = false; // limit unit select to unit type - if (!empty($line->fk_unit) && empty($conf->global->MAIN_EDIT_LINE_ALLOW_ALL_UNIT_TYPE)){ - if (!class_exists('CUnits')) include_once DOL_DOCUMENT_ROOT . '/core/class/cunits.class.php'; + if (!empty($line->fk_unit) && empty($conf->global->MAIN_EDIT_LINE_ALLOW_ALL_UNIT_TYPE)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $cUnit = new CUnits($line->db); - if ($cUnit->fetch($line->fk_unit) > 0){ - if (!empty($cUnit->unit_type)){ + if ($cUnit->fetch($line->fk_unit) > 0) { + if (!empty($cUnit->unit_type)) { $unit_type = $cUnit->unit_type; } }