Commit b7186bd6 by Alexis Aoun

feat: lors d'un scan le poids est automatiquement detecte

Lorsque l'on scan un produit dont la quantite est en poids, celui ci est automatiquement affecte a l'input de
la ligne d'edition
parent e29b2ce7
......@@ -68,6 +68,10 @@ function select_product_from_bc(barcode) {
try {
if (editing_product == null) {
let p = barcodes.get_corresponding_odoo_product(barcode);
var qtyIsWeight = false;
console.log(p);
if (p == null) {
alert("Le code-barre " + barcode + " ne correspond à aucun article connu.");
......@@ -75,6 +79,11 @@ function select_product_from_bc(barcode) {
return -1;
}
console.log(p.rule);
if(p.rule == 'weight')
qtyIsWeight = true;
var found = {data: null, place: null};
$.each(list_to_process, function(i, e) {
......@@ -93,6 +102,9 @@ function select_product_from_bc(barcode) {
});
}
if(qtyIsWeight)
found.data.product_qty = p.qty;
if (found.data !== null) {
setLineEdition(found.data);
if (found.place === 'to_process') {
......@@ -792,6 +804,8 @@ function set_supplier_shortage(row, product, from_processed = false) {
// Set edition
function setLineEdition(product) {
editing_product = product;
console.log(editing_product);
// name
document.getElementById('product_name').innerHTML = editing_product.product_id[1];
......
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