From 7ba46dc8cb5b758dfc53409964f5d5f7515a54a8 Mon Sep 17 00:00:00 2001 From: ATM-nicolasV Date: Wed, 2 Oct 2024 16:53:07 +0200 Subject: [PATCH] =?UTF-8?q?fix=20erreur=20sql=20si=20l'entrep=C3=B4t=20ne?= =?UTF-8?q?=20poss=C3=A9de=20pas=20de=20sous=20entrep=C3=B4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/product/inventory/class/inventory.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 29c1ffb902421..560cb3e1b7de5 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -297,7 +297,9 @@ public function validate(User $user, $notrigger = false, $include_sub_warehouse if (!empty($include_sub_warehouse) && getDolGlobalInt('INVENTORY_INCLUDE_SUB_WAREHOUSE')) { $TChildWarehouses = array(); $this->getChildWarehouse($this->fk_warehouse, $TChildWarehouses); - $sql .= " OR ps.fk_entrepot IN (".$this->db->sanitize(join(',', $TChildWarehouses)).")"; + if (!empty($TChildWarehouses)) { + $sql .= " OR ps.fk_entrepot IN (".$this->db->sanitize(join(',', $TChildWarehouses)).")"; + } } $sql .= ')'; }