[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) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
pedrambiria
2023-04-04 16:02:18 +02:00
parent 44052d58d7
commit 739862d965
+1 -1
View File
@@ -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) {