This commit is contained in:
Laurent Destailleur 2026-04-23 13:20:30 +02:00
parent 557c9bbafc
commit 27f89cc62a

View file

@ -314,8 +314,20 @@ class Proposals extends DolibarrApi
if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403, "Insufficiant rights");
}
// Check mandatory fields
$result = $this->_validate($request_data);
$this->_validate($request_data);
// Check thirdparty validity
$socid = (int) $request_data['socid'];
$thirdpartytmp = new Societe($this->db);
$thirdparty_result = $thirdpartytmp->fetch($socid);
if ($thirdparty_result < 1) {
throw new RestException(404, 'Thirdparty with id='.$socid.' not found or not allowed');
}
if (!DolibarrApi::_checkAccessToResource('societe', $thirdpartytmp->id)) {
throw new RestException(404, 'Thirdparty with id='.$thirdpartytmp->id.' not found or not allowed');
}
foreach ($request_data as $field => $value) {
if ($field === 'caller') {