Merge pull request #14412 from egils-consulting/patch-3

Update api_products.class.php
This commit is contained in:
Laurent Destailleur 2020-08-07 12:03:40 +02:00 committed by GitHub
commit 4468c5cfb0
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;
}