[FIX] point_of_sale: barcode patterns must match barcode as prefix, (and not anywhere in barcode)
This commit is contained in:
@@ -155,7 +155,14 @@ openerp.barcodes = function(instance) {
|
||||
match['base_code'] = match['base_code'].replace("\\\\", "\\").replace("\{", "{").replace("\}","}").replace("\.",".");
|
||||
}
|
||||
|
||||
match['match'] = match['base_code'].substr(0,base_pattern.length).match(base_pattern);
|
||||
if (base_pattern[0] !== '^') {
|
||||
base_pattern = "^" + base_pattern;
|
||||
}
|
||||
if (base_pattern[base_pattern.length -1] !== '$') {
|
||||
base_pattern = base_pattern + ".*$";
|
||||
}
|
||||
match.match = match.base_code.match(base_pattern);
|
||||
|
||||
return match;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user