[imp] warning product not recognized
bzr revid: rlo@openerp.com-20120326122743-3m6c24j0dnb9c1yq
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -141,6 +141,9 @@
|
||||
</a>
|
||||
</span>
|
||||
</t>
|
||||
<t t-name="pos-scan-warning">
|
||||
<div>The product could not be recognized. Please contact an employee.</div>
|
||||
</t>
|
||||
<t t-name="pos-close-warning">
|
||||
<div>There are pending operations that could not be saved into the database, are you sure you want to exit?</div>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user