Legacy filter expressions are no longer compatible after a JSON parsing change.
The issue arises from a change in how filter expressions are parsed, causing legacy expressions in workspace shortcuts to fail. The fix requires handling both JSON and legacy expressions or migrating existing data. The scope is somewhat clear but involves compatibility concerns.
PR #37421 changed frappe.utils.process_filter_expression() from evaluating the stored filter string to strict JSON.parse().
That causes a regression for existing Workspace Shortcut stats_filter values that are not strict JSON but are still present in standard ERPNext workspace fixtures. Some shipped shortcuts use expressions such as frappe.defaults.get_global_default("company") or frappe.session.user inside the filter definition.
After this change, those filters are still stored in the database, but they are parsed as empty at runtime.
Output of bench version
erpnext 15.101.0
frappe 15.102.0
hrms 15.33.2
stats_filter contains expressions, for example:
Invalid JSON in filter expression.Existing shipped workspace shortcut filters should continue to work, or there should be a compatibility / migration path so that previously valid shortcut filters are not silently dropped.
Invalid JSON in filter expression { ... }
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!