diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 84c4d695829..70de88dd93e 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1298,10 +1298,26 @@ openerp.point_of_sale = function(db) { price = ''; } var scannedProductModel = _.detect(productsCollection.models, function(pc) { return pc.attributes.ean13 === barcode;}); + if (scannedProductModel == undefined) { + // product not recognized, raise warning + $(QWeb.render('pos-scan-warning')).dialog({ + resizable: false, + height:160, + modal: true, + title: "Warning", + buttons: { + "OK": function() { + $( this ).dialog( "close" ); + }, + } + }); + } if (weight === '' && price !== '') { + // product sold by price scannedProductModel.price = price; } else if (weight !== '' && price === '') { - // TODO sell by weight: how to calculate the price? + // product sold by weight + // TODO check how to calculate the price scannedProductModel.price *= weight; } selectedOrder.addProduct(scannedProductModel); diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index d24d16713d8..16192f208c8 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -141,6 +141,9 @@ + + The product could not be recognized. Please contact an employee. + There are pending operations that could not be saved into the database, are you sure you want to exit?