Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Workspace shortcut filters with legacy expressions stop working after #37421 | GoodFirstPicks

Workspace shortcut filters with legacy expressions stop working after #37421

frappe/frappe 10 comments 17d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeFrappe / ERPNextPython

Why this is a good first issue

Legacy filter expressions are no longer compatible after a JSON parsing change.

AI Summary

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.

Issue Description

Description of the issue

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.

Context information (for bug reports)

Output of bench version

erpnext 15.101.0
frappe 15.102.0
hrms 15.33.2

Steps to reproduce the issue

  1. Run a site on a version that includes #37421 (for example current v15 with ERPNext installed).
  2. Open a standard ERPNext workspace such as Buying, Selling, or Stock.
  3. Check shortcuts whose shipped stats_filter contains expressions, for example:
    • Buying -> Material Request / Purchase Order
    • Selling -> Sales Order
    • Stock -> Material Request / Delivery Note / Purchase Receipt
  4. Observe the badge count, click-through behavior, and the shortcut's filter when opening workspace customization.

Observed result

  • Browser console shows Invalid JSON in filter expression.
  • The shortcut count badge is calculated without the intended filter.
  • Clicking the shortcut opens the unfiltered list view.
  • In workspace customization, the existing filter can appear empty / lost.

Expected result

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.

Stacktrace / full error message

Invalid JSON in filter expression { ... }

Additional

GitHub Labels

bug

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • legacy compatibility
  • database migration
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno
Assigneeiamejaaz