From 821b423a240d3a9aa8a354360042488d91919c45 Mon Sep 17 00:00:00 2001 From: muhalikin <40883042+muhalikin@users.noreply.github.com> Date: Wed, 8 Feb 2023 15:34:18 +0300 Subject: [PATCH] Fix Shipment Creation from Order via REST API --- htdocs/commande/class/api_orders.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 1a879173684..0318cbcd5bf 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -1053,6 +1053,7 @@ class Orders extends DolibarrApi } $shipment = new Expedition($this->db); $shipment->socid = $this->commande->socid; + $shipment->origin_id = $this->commande->id; $result = $shipment->create(DolibarrApiAccess::$user); if ($result <= 0) { throw new RestException(500, 'Error on creating expedition :'.$this->db->lasterror());