Repository: openfoodfacts/openfoodfacts-androidapp
Issue: Weight does not seem to go through on new products

Steps to reproduce: 

- Send new product with units and value

Result: 

- No units nor value stored.

Changed files:
app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIClient.java
app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIService.java
app/src/test/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIServiceTest.java

diff --git a/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIClient.java b/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIClient.java
index 00ab17275..c735286b4 100644
--- a/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIClient.java
+++ b/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIClient.java
@@ -210,7 +210,7 @@ public class OpenFoodAPIClient {
         lt.setTextColor(activity.getResources().getColor(R.color.white));
         lt.show();
 
-        apiService.saveProduct(product.getBarcode(), product.getName(), product.getBrands(), product.getUserId(), product.getPassword(), PRODUCT_API_COMMENT).enqueue(new Callback<State>() {
+        apiService.saveProduct(product.getBarcode(), product.getName(), product.getBrands(), product.getQuantity(), product.getUserId(), product.getPassword(), PRODUCT_API_COMMENT).enqueue(new Callback<State>() {
             @Override
             public void onResponse(Call<State> call, Response<State> response) {
                 if (!response.isSuccess() || response.body().getStatus() == 0) {
diff --git a/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIService.java b/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIService.java
index 6a83d310b..246c18610 100644
--- a/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIService.java
+++ b/app/src/main/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIService.java
@@ -49,6 +49,7 @@ public interface OpenFoodAPIService {
     Call<State> saveProduct(@Query("code") String code,
                             @Query("product_name") String name,
                             @Query("brands") String brands,
+                            @Query("quantity") String quantity,
                             @Query("user_id") String login,
                             @Query("password") String password,
                             @Query("comment") String comment);
diff --git a/app/src/test/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIServiceTest.java b/app/src/test/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIServiceTest.java
index 81baf5a47..720617eb9 100644
--- a/app/src/test/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIServiceTest.java
+++ b/app/src/test/java/openfoodfacts/github/scrachx/openfood/network/OpenFoodAPIServiceTest.java
@@ -221,9 +221,11 @@ public class OpenFoodAPIServiceTest {
         product.setBarcode("978020137962");
         product.setName("coca");
         product.setBrands("auchan");
+        product.setWeight("300");
+        product.setWeight_unit("g");
 
 //        Response<State> execute = serviceWrite.saveProduct(product).execute();
-        Response<State> execute = serviceWrite.saveProduct(product.getBarcode(), product.getName(), product.getBrands(), null, null, PRODUCT_API_COMMENT).execute();
+        Response<State> execute = serviceWrite.saveProduct(product.getBarcode(), product.getName(), product.getBrands(), product.getQuantity(), null, null, PRODUCT_API_COMMENT).execute();
 
         assertTrue(execute.isSuccess());
 
@@ -236,6 +238,7 @@ public class OpenFoodAPIServiceTest {
         assertEquals(product.getName(), savedProduct.getProductName());
         assertEquals(product.getBrands(), savedProduct.getBrands());
         assertTrue(savedProduct.getBrandsTags().contains(product.getBrands()));
+        assertEquals(product.getWeight() + " " + product.getWeight_unit(), savedProduct.getQuantity());
     }
 
     @Test