From af26ac9e2970015116e05d658720af3f4e9b4398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Kawala?= Date: Sun, 17 May 2020 11:41:22 +0200 Subject: [PATCH] Fix version and add comments. --- pos_accented_search/__manifest__.py | 2 +- pos_accented_search/static/src/js/db.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pos_accented_search/__manifest__.py b/pos_accented_search/__manifest__.py index f320d8a1..4dea3855 100644 --- a/pos_accented_search/__manifest__.py +++ b/pos_accented_search/__manifest__.py @@ -1,7 +1,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': "Point of Sale - Accented Product Search", - 'version': '12.0.0.0.2', + 'version': '12.0.1.0.0', 'category': 'Point of Sale', 'summary': 'Point of Sale - Product search works regardless of accented characters', 'author': "Le Nid, Odoo Community Association (OCA)", diff --git a/pos_accented_search/static/src/js/db.js b/pos_accented_search/static/src/js/db.js index 519c72cd..7998ed6d 100644 --- a/pos_accented_search/static/src/js/db.js +++ b/pos_accented_search/static/src/js/db.js @@ -5,6 +5,10 @@ odoo.define('pos_accented_search', function (require) { db.include({ normalize_characters: function (product) { + // The normalization extract out combining diacritical marks + // All those diacritics in range [\u0300-\u036f]. + // See https://en.wikipedia.org/wiki/Combining_Diacritical_Marks. + // All the diacritics are removed by the code below. return product.normalize("NFD") .replace(/[\u0300-\u036f]/g, "") .replace(/[\u0152-\u0153]/g, "oe");