From 7f2eda43ce553cc7dade1705990f481e9561856b Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Fri, 19 Nov 2021 13:02:01 +0000 Subject: [PATCH] [FIX] point_of_sale: localeCompare is not a function when name is false When the loaded res.partner has `name` = false, the call to localeCompare fails because boolean doesn't have the method. Note that `name` field of res.partner can be false because no default is specified in its declaration in the base module. closes odoo/odoo#80501 X-original-commit: 9b4daee15f901f53239fffdf27a9b42c78dac3e5 Signed-off-by: Trinh Jacky (trj) --- .../static/src/js/Screens/ClientListScreen/ClientListScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientListScreen.js b/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientListScreen.js index d8f5e7c7e01..02dd6be189c 100644 --- a/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientListScreen.js +++ b/addons/point_of_sale/static/src/js/Screens/ClientListScreen/ClientListScreen.js @@ -74,7 +74,7 @@ odoo.define('point_of_sale.ClientListScreen', function(require) { } else { res = this.env.pos.db.get_partners_sorted(1000); } - return res.sort(function (a, b) { return a.name.localeCompare(b.name) }); + return res.sort(function (a, b) { return (a.name || '').localeCompare(b.name || '') }); } get isNextButtonVisible() { return this.state.selectedClient ? true : false;