Merge pull request #32838 from hregis/fix_20_dolistore

FIX if $force_entity = 0 ($force_entity != 'default') = false
This commit is contained in:
Laurent Destailleur 2025-01-29 00:09:10 +01:00 committed by GitHub
commit 97646f0000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2195,7 +2195,7 @@ class Form
$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
}
// Condition here should be the same than into societe->getSalesRepresentatives().
if ($userissuperadminentityone && $force_entity != 'default') {
if ($userissuperadminentityone && $force_entity !== 'default') {
if (!empty($force_entity)) {
$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
} else {