Commit a6f73d2a by Félicie

alert changed

parent edd0e0df
Pipeline #2255 passed with stage
in 1 minute 27 seconds
...@@ -396,32 +396,30 @@ var addProductToList = async function(barcode) { ...@@ -396,32 +396,30 @@ var addProductToList = async function(barcode) {
//It could also be a wrong reading one //It could also be a wrong reading one
odoo_product = barcodes.get_corresponding_odoo_product(barcode); odoo_product = barcodes.get_corresponding_odoo_product(barcode);
if (odoo_product) { if (odoo_product === null) {
alert(barcode + " : ce code-barre est inconnu, merci d'apporter le produit à un salarié.");
} else {
if (is_product_in_shelf_adding_queue_list(odoo_product.data[barcodes.keys.id])) { if (is_product_in_shelf_adding_queue_list(odoo_product.data[barcodes.keys.id])) {
alert("Produit déjà présent dans la liste."); alert("Produit déjà présent dans la liste.");
} else { } else {
add_to_shelf_product_ids.push(odoo_product.data[4]); add_to_shelf_product_ids.push(odoo_product.data[4]);
if (odoo_product === null) { var pdt_line = $('<tr>').attr('data-id', odoo_product.data[barcodes.keys.id])
alert(barcode + ' : Code-barre inconnu'); .attr('data-bc', odoo_product.barcode)
} else { .addClass('obc');
var pdt_line = $('<tr>').attr('data-id', odoo_product.data[barcodes.keys.id])
.attr('data-bc', odoo_product.barcode) $('<td>').text(barcode)
.addClass('obc'); .appendTo(pdt_line);
$('<td>').text(odoo_product.barcode)
$('<td>').text(barcode) .appendTo(pdt_line);
.appendTo(pdt_line); $('<td>').text(odoo_product.data[barcodes.keys.name])
$('<td>').text(odoo_product.barcode) .appendTo(pdt_line);
.appendTo(pdt_line); $('<td>').html(odoo_product.data[barcodes.keys.list_price] + " €")
$('<td>').text(odoo_product.data[barcodes.keys.name]) .appendTo(pdt_line);
.appendTo(pdt_line); $('<td>').html(delete_icon + " " + print_icon)
$('<td>').html(odoo_product.data[barcodes.keys.list_price] + " €") .appendTo(pdt_line);
.appendTo(pdt_line); adding_pdts_tpl.find('#added_products tbody').append(pdt_line);
$('<td>').html(delete_icon + " " + print_icon) main_content.find('button.add-products').css('display', 'block')
.appendTo(pdt_line); .html(add_pdts_btn_text);
adding_pdts_tpl.find('#added_products tbody').append(pdt_line);
main_content.find('button.add-products').css('display', 'block')
.html(add_pdts_btn_text);
}
} }
} }
}; };
......
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