From b6db04a727402b66973fcd69a17ba8d73310db6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Aug 2019 22:42:04 +0200 Subject: [PATCH] Fix add missing filter on entity on stock listing for product combo --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ad81f7d7a2b..1666901d04a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2082,7 +2082,7 @@ class Form if (count($warehouseStatusArray)) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; $sql.= ' AND e.statut IN ('.$this->db->escape(implode(',',$warehouseStatusArray)).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. }