Update api_products.class.php

fixes #14309 
Throw 400 and add hint to user about using the right endpoint.
This commit is contained in:
Egils Consulting 2020-08-07 00:06:48 +02:00 committed by GitHub
parent e6c4c8082e
commit 9c254159ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,6 +286,9 @@ class Products extends DolibarrApi
foreach ($request_data as $field => $value) {
if ($field == 'id') { continue;
}
if ($field == 'stock_reel') {
throw new RestException(400, 'Stock reel cannot be updated here. Use the /stockmovements endpoint instead');
}
$this->product->$field = $value;
}