diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 3486a962ee6..14fd8b86dad 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3570,7 +3570,7 @@ class Product extends CommonObject $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; } $sql .= " WHERE m.rowid = mp.fk_mo"; - $sql .= " AND m.entity IN (".getEntity($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'mrp').")"; + $sql .= " AND m.entity IN (".getEntity(($forVirtualStock && getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE')) ? 'stock' : 'mrp').")"; $sql .= " AND mp.fk_product = ".((int) $this->id); $sql .= " AND mp.disable_stock_change IN (0)"; if (!$user->hasRight('societe', 'client', 'voir') && !$forVirtualStock) {