From 739862d9650761610aa0e04467dc5f5cf419edd7 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Mon, 27 Mar 2023 13:34:30 +0000 Subject: [PATCH] [FIX] point_of_sale: handle line breaks in product search Before this commit: the `product.display_name` field could contain line breaks, which prevented it from being matched correctly by regular expressions. This commit fixes the issue by modifying the `_product_search_string()` function to remove line breaks. opw-3239830 closes odoo/odoo#117626 X-original-commit: f598903fe06e44a03dc0ea1a20ef2667b42eed08 Signed-off-by: Trinh Jacky (trj) Signed-off-by: Pedram Bi Ria (pebr) --- 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 159c78d5865..849f2229755 100644 --- a/addons/point_of_sale/static/src/js/db.js +++ b/addons/point_of_sale/static/src/js/db.js @@ -177,7 +177,7 @@ export const PosDB = core.Class.extend({ if (product.description_sale) { str += "|" + product.description_sale; } - str = product.id + ":" + str.replace(/:/g, "") + "\n"; + str = product.id + ":" + str.replace(/[\n:]/g, "") + "\n"; return str; }, add_products: function (products) {