Commit d36aa518 by Damien Moulard

reception: dont add unchanged product to updated products list

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