From 6e16a8a54461ca4aaeb87d3231d8e01094b77a2e Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Wed, 5 Aug 2020 08:35:49 +0100 Subject: [PATCH 1/2] fix: fetch reception on supplier order dispatch fetch --- htdocs/fourn/class/fournisseur.commande.dispatch.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 518c6885411..d85a4e0941a 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -290,7 +290,9 @@ class CommandeFournisseurDispatch extends CommonObject $this->batch = $obj->batch; $this->eatby = $this->db->jdate($obj->eatby); $this->sellby = $this->db->jdate($obj->sellby); - $this->fetch_optionals(); + $this->fk_reception = $obj->fk_reception; + + $this->fetch_optionals(); } $this->db->free($resql); From 9c254159ab8dad8477c1814beaaf2f6c54d30c4b Mon Sep 17 00:00:00 2001 From: Egils Consulting Date: Fri, 7 Aug 2020 00:06:48 +0200 Subject: [PATCH 2/2] Update api_products.class.php fixes #14309 Throw 400 and add hint to user about using the right endpoint. --- htdocs/product/class/api_products.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 1f4bbf870f3..89c9a78ddaa 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -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; }