You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
664 B

  1. odoo.define('pos_accented_search', function (require) {
  2. "use strict";
  3. var db = require("point_of_sale.DB");
  4. db.include({
  5. normalize_characters: function (product) {
  6. return product.normalize("NFD")
  7. .replace(/[\u0300-\u036f]/g, "")
  8. .replace(/[\u0152-\u0153]/g, "oe");
  9. },
  10. _product_search_string: function (product) {
  11. return this.normalize_characters(this._super(product));
  12. },
  13. search_product_in_category: function (category_id, query) {
  14. return this._super(category_id, this.normalize_characters(query));
  15. },
  16. });
  17. return db;
  18. });