From bf0556bdf12f9fdbcc885e569e9ca6ec725f873d Mon Sep 17 00:00:00 2001 From: Quentin Vial-Gouteyron Date: Mon, 26 Sep 2016 10:47:54 +0200 Subject: [PATCH 1/2] NEW Trigger on delete stock --- htdocs/product/stock/class/entrepot.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index acbde6a8b07..92f3e8cbff7 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -221,6 +221,14 @@ class Entrepot extends CommonObject { $this->db->begin(); + if (! $error && empty($notrigger)) + { + // Call trigger + $result=$this->call_trigger('STOCK_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers + } + $elements = array('stock_mouvement','product_stock','product_warehouse_properties'); foreach($elements as $table) { From 4d828499ac9e4c66385c4b6600582980fdb34a6c Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 26 Sep 2016 14:41:30 +0200 Subject: [PATCH 2/2] Update entrepot.class.php --- htdocs/product/stock/class/entrepot.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 92f3e8cbff7..30165a4f732 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -224,7 +224,7 @@ class Entrepot extends CommonObject if (! $error && empty($notrigger)) { // Call trigger - $result=$this->call_trigger('STOCK_DELETE',$user); + $result=$this->call_trigger('WAREHOUSE_DELETE',$user); if ($result < 0) { $error++; } // End call triggers }