[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:
Stéphane Bidoul (ACSONE)
2015-06-26 08:51:25 +02:00
committed by Nicolas Martinelli
parent 745e4426b4
commit 4213eebe2e
+1 -1
View File
@@ -362,7 +362,7 @@ function openerp_pos_db(instance, module){
search_product_in_category: function(category_id, query){
try {
query = query.replace(/[\[\]\(\)\+\*\?\.\-\!\&\^\$\|\~\_\{\}\:\,\\\/]/g,'.');
query = query.replace(' ','.+');
query = query.replace(/ /g,'.+');
var re = RegExp("([0-9]+):.*?"+query,"gi");
}catch(e){
return [];