Commit 0ff3cd09 by Yvon Kerdoncuff

Merge branch 'reception-not-updated-product' into 'dev_cooperatic'

reception: dont add unchanged product to updated products list

See merge request !235
parents 795674e4 d36aa518
Pipeline #2883 failed with stage
in 1 minute 4 seconds
......@@ -1270,7 +1270,7 @@ function editProductInfo (productToEdit, value = null, batch = false) {
// Check if the product is already in the 'updated' list
var index = searchUpdatedProduct();
var firstUpdate = false;
var isValid = false;
var isValid = false; // "valid" == no change from initial value
let newValue = value;
var addition = false;
......@@ -1418,9 +1418,7 @@ function editProductInfo (productToEdit, value = null, batch = false) {
// If the product info has been updated and for the first time
if (firstUpdate) {
updatedProducts.push(productToEdit);
//if product is validated thru edition -> add to valid_products
//if product is validated thru edition without change -> add to valid_products
if (isValid) {
// Create 'valid_products' list in order if not exists
if (!orders[productToEdit.id_po]['valid_products']) {
......@@ -1428,6 +1426,8 @@ function editProductInfo (productToEdit, value = null, batch = false) {
}
orders[productToEdit.id_po]['valid_products'].push(productToEdit['id']);
} else {
updatedProducts.push(productToEdit);
// Create 'updated_products' list in order if not exists
if (!orders[productToEdit.id_po]['updated_products']) {
orders[productToEdit.id_po]['updated_products'] = [];
......
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