Commit 33de9df2 by Damien Moulard

REC: reset data on add products modal opening

parent 0c9150b6
...@@ -2046,7 +2046,7 @@ function openErrorReport() { ...@@ -2046,7 +2046,7 @@ function openErrorReport() {
*/ */
function set_products_autocomplete() { function set_products_autocomplete() {
// Filter autocomplete products on products already selected // Filter autocomplete products on products already selected
let autocomplete_products = autocomplete_products.filter(p => products_to_add.findIndex(pta => pta.name === p.name) === -1); let autocomplete_products = suppliers_products.filter(p => products_to_add.findIndex(pta => pta.name === p.name) === -1);
try { try {
$("#modal .search_product_input").autocomplete("destroy"); $("#modal .search_product_input").autocomplete("destroy");
...@@ -2129,6 +2129,7 @@ function set_add_products_modal() { ...@@ -2129,6 +2129,7 @@ function set_add_products_modal() {
false false
); );
products_to_add = []; // Reset on modal opening
set_products_autocomplete(); set_products_autocomplete();
} }
} }
......
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