From 2751d5cefdcc63703a549d04fe6c6161115b6971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Thu, 3 Dec 2020 16:02:49 +0100 Subject: [PATCH] Update api_orders.class.php --- htdocs/commande/class/api_orders.class.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 2f4eb6ea996..3442b9316f7 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -622,13 +622,7 @@ class Orders extends DolibarrApi if ($this->commande->availability($this->commande->availability_id) < 0) throw new RestException(400, 'Error while updating availability'); } - - // Update demand reason - if (!empty($this->commande->demand_reason_id) && $this->commande->demand_reason_id > 0) { - if ($this->commande->demand_reason($this->commande->demand_reason_id) < 0) - throw new RestException(400, 'Error while updating demand reason'); - } - + if ($this->commande->update(DolibarrApiAccess::$user) > 0) { return $this->get($id);