2
0
forked from Wavyzz/dolibarr

FIX make of link to other object during creation

This commit is contained in:
Laurent Destailleur
2017-10-19 19:06:48 +02:00
parent d4ade7b935
commit f7556e7ad2
9 changed files with 208 additions and 55 deletions

View File

@@ -196,6 +196,7 @@ class Orders extends DolibarrApi
}
$this->commande->lines = $lines;
}*/
if ($this->commande->create(DolibarrApiAccess::$user) < 0) {
throw new RestException(500, "Error creating order", array_merge(array($this->commande->error), $this->commande->errors));
}
@@ -386,7 +387,7 @@ class Orders extends DolibarrApi
/**
* Update order general fields (won't touch lines of order)
*
* @param int $id Id of commande to update
* @param int $id Id of order to update
* @param array $request_data Datas
*
* @return int
@@ -398,7 +399,7 @@ class Orders extends DolibarrApi
$result = $this->commande->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Commande not found');
throw new RestException(404, 'Order not found');
}
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {