You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[base_geoengine] TypeError when searching in records panel
Module
base_geoengine
Describe the bug
When attempting to filter records using the search bar within the Geoengine records panel, a JavaScript TypeError: Cannot read properties of undefined (reading 'toLowerCase') is thrown, resulting in an Odoo Client Error popup.
This occurs in records_panel.esm.js within the filterItems method because the code assumes item.data.display_name (or item.data.name in earlier revisions) will always be a populated string. If a record lacks a display name, it evaluates to undefined or false, causing the .toLowerCase() call to fail and breaking the filter functionality.
Navigate to a contacts module containing a Geoengine view (e.g., Contacts map view).
Click on the geoengine view (with the 🌏 logo)
Start typing in the "CONTACT" search bar located on the right panel to filter the records.
An "Oops!" Odoo Client Error modal appears displaying the TypeError. Expected behavior
The search bar should safely filter the displayed list of records without throwing an exception, gracefully handling cases where a record's display name might be undefined or empty.
Additional context
The problematic code block in base_geoengine/static/src/js/views/geoengine/records_panel/records_panel.esm.js:
[base_geoengine] TypeError when searching in records panel
Module
base_geoengineDescribe the bug
When attempting to filter records using the search bar within the Geoengine records panel, a JavaScript
TypeError: Cannot read properties of undefined (reading 'toLowerCase')is thrown, resulting in an Odoo Client Error popup.This occurs in
records_panel.esm.jswithin thefilterItemsmethod because the code assumesitem.data.display_name(oritem.data.namein earlier revisions) will always be a populated string. If a record lacks a display name, it evaluates toundefinedorfalse, causing the.toLowerCase()call to fail and breaking the filter functionality.To Reproduce
Affected versions:
18.0Steps to reproduce the behavior:
geoengine_partnerfrom here [18.0] [MIG] geoengine_partner #460 , as the module includes the view where the error occurs.TypeError.Expected behavior
The search bar should safely filter the displayed list of records without throwing an exception, gracefully handling cases where a record's display name might be undefined or empty.
Additional context
The problematic code block in
base_geoengine/static/src/js/views/geoengine/records_panel/records_panel.esm.js:geospatial/base_geoengine/static/src/js/views/geoengine/records_panel/records_panel.esm.js
Lines 70 to 75 in d4b0d72