[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) <trj@odoo.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user