From 4213eebe2ebe6b0c81580176b263aeee9fa6a3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Mon, 13 Apr 2015 19:35:23 +0200 Subject: [PATCH] [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 --- addons/point_of_sale/static/src/js/db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/db.js b/addons/point_of_sale/static/src/js/db.js index ed3a72c7e28..819c21fb37b 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -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 [];