[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-04-13 19:35:23 +02:00 committed by Nicolas Martinelli
parent 745e4426b4
commit 4213eebe2e
1 changed files with 1 additions and 1 deletions

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 [];