Commit d4300f92 by Alexis Aoun

refactor

parent f1770131
...@@ -63,7 +63,6 @@ function searchUpdatedProduct() { ...@@ -63,7 +63,6 @@ function searchUpdatedProduct() {
// Directly send a line to edition when barcode is read // Directly send a line to edition when barcode is read
function select_product_from_bc(barcode) { function select_product_from_bc(barcode) {
try { try {
if (editing_product == null) { if (editing_product == null) {
let p = barcodes.get_corresponding_odoo_product(barcode); let p = barcodes.get_corresponding_odoo_product(barcode);
...@@ -82,11 +81,10 @@ function select_product_from_bc(barcode) { ...@@ -82,11 +81,10 @@ function select_product_from_bc(barcode) {
} }
}); });
if (found.data == null) { if (found.data == null) {
$.each(list_processed, function(i, e) { $.each(list_processed, function(i, e) {
if (e.product_id[0] == p.data[barcodes['keys']['id']]) { if (e.product_id[0] == p.data[barcodes['keys']['id']]) {
found.data = JSON.parse(JSON.stringify(e)); found.data = JSON.parse(JSON.stringify(e));
found.place = 'processed'; found.place = 'processed';
} }
}); });
...@@ -798,10 +796,8 @@ function editProductInfo (productToEdit, value = null) { ...@@ -798,10 +796,8 @@ function editProductInfo (productToEdit, value = null) {
var index = searchUpdatedProduct(); var index = searchUpdatedProduct();
var firstUpdate = false; var firstUpdate = false;
let newValue = value; let newValue = value;
var addition = false; var addition = false;
// If 'value' parameter not set, get value from edition input // If 'value' parameter not set, get value from edition input
if (value == null) { if (value == null) {
newValue = parseFloat(document.getElementById('edition_input').value.replace(',', '.')); newValue = parseFloat(document.getElementById('edition_input').value.replace(',', '.'));
......
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