From 2c90f7335ea26149688d21977372e76f87b52649 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 5 Apr 2023 11:42:50 +0200 Subject: [PATCH] FIX : Travis --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 7745d05d71a..97075ddd440 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -638,8 +638,8 @@ class Mo extends CommonObject $oldQty = $this->oldQty; $newQty = $this->qty; - if($newQty != $oldQty) { - $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . $this->id; + if($newQty != $oldQty && !empty($this->oldQty)) { + $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . (int) $this->id; $resql = $this->db->query($sql); if($resql) { while ($obj = $this->db->fetch_object($resql)) {