[FIX] point_of_sale: correctly split workds in product search
The JS replace method, unlike python's, only replaces the first occurence unless a search pattern is provided. Closes #6302
This commit is contained in:
parent
745e4426b4
commit
4213eebe2e
|
@ -362,7 +362,7 @@ function openerp_pos_db(instance, module){
|
||||||
search_product_in_category: function(category_id, query){
|
search_product_in_category: function(category_id, query){
|
||||||
try {
|
try {
|
||||||
query = query.replace(/[\[\]\(\)\+\*\?\.\-\!\&\^\$\|\~\_\{\}\:\,\\\/]/g,'.');
|
query = query.replace(/[\[\]\(\)\+\*\?\.\-\!\&\^\$\|\~\_\{\}\:\,\\\/]/g,'.');
|
||||||
query = query.replace(' ','.+');
|
query = query.replace(/ /g,'.+');
|
||||||
var re = RegExp("([0-9]+):.*?"+query,"gi");
|
var re = RegExp("([0-9]+):.*?"+query,"gi");
|
||||||
}catch(e){
|
}catch(e){
|
||||||
return [];
|
return [];
|
||||||
|
|
Loading…
Reference in New Issue