Merge pull request #13866 from Tim-Otte/fix-11948

FIX #11948
This commit is contained in:
Laurent Destailleur 2020-05-12 03:07:53 +02:00 committed by GitHub
commit f6ac2d2545
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5387,11 +5387,11 @@ class Product extends CommonObject
$label_type = 'short_label';
}
$sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
$sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
$resql = $this->db->query($sql);
if ($resql && $this->db->num_rows($resql) > 0) {
$res = $this->db->fetch_array($resql);
$label = $res[$label_type];
$label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']);
$this->db->free($resql);
return $label;
}