Merge pull request #23835 from muhalikin/patch-1

Fix Shipment Creation from Order via REST API
This commit is contained in:
Laurent Destailleur 2023-02-08 15:29:22 +01:00 committed by GitHub
commit 6a4f697013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());