Commit 67d6f2e7 by Yvon Kerdoncuff

#7152 stock movement : deepcopy products to fix bug preventing retry after error…

#7152 stock movement : deepcopy products to fix bug preventing retry after error due to products_table modification
parent 12b7e7e9
......@@ -493,7 +493,15 @@ function confirm_movement() {
error_in_table = true;
}
tmp_products_data.push(data);
//Prepare the data container for the sending phase
//Deep copy is required not to modify data as,
//in case of error (more frequent now with stock availability on),
//we may want to retry the stock movement
//(modifying data, especially removing uom and replacing it by uom_id,
//as done before sending data, will cause an error)
let product_deep_copy = JSON.parse(JSON.stringify(data));
tmp_products_data.push(product_deep_copy);
return 0;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment