Update api_products.class.php
fixes #14309 Throw 400 and add hint to user about using the right endpoint.
This commit is contained in:
parent
e6c4c8082e
commit
9c254159ab
@ -286,6 +286,9 @@ class Products extends DolibarrApi
|
|||||||
|
|
||||||
foreach ($request_data as $field => $value) {
|
foreach ($request_data as $field => $value) {
|
||||||
if ($field == 'id') { continue;
|
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;
|
$this->product->$field = $value;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user