Skip to content
Snippets Groups Projects
Commit c8732bea authored by Frédéric van der Essen's avatar Frédéric van der Essen Committed by Frédéric van der Essen
Browse files

[FIX] point_of_sale: ignore unrecognized barcodes in popups

When a popup is displayed in the point of sale, it sets-up its
own barcode callbacks to prevent the screen's default barcode
action. If a barcode doesn't handle such a barcode, and has not
been setup to handle errors either, it will be ignored, and
a warning will be emitted to the console.
parent 04baede1
Branches
Tags
No related merge requests found
......@@ -522,19 +522,12 @@ var BarcodeReader = core.Class.extend({
return;
}
var parsed_result = this.barcode_parser.parse_barcode(code);
if(parsed_result.type in {'product':'', 'weight':'', 'price':''}){ //barcode is associated to a product
if(this.action_callback.product){
this.action_callback.product(parsed_result);
}
}
else if (parsed_result.type in {'cashier':'', 'client':'', 'discount':''}){
if(this.action_callback[parsed_result.type]){
this.action_callback[parsed_result.type](parsed_result);
}
}
else{
if (this.action_callback[parsed_result.type]) {
this.action_callback[parsed_result.type](parsed_result);
} else if (this.action_callback.error) {
this.action_callback.error(parsed_result);
} else {
console.warn("Ignored Barcode Scan:", parsed_result);
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment