What's New
p Press • perf other-apps

Avoid redundant Team doc loads and N+1 queries

SS @ssiyad · #6997 · merged 28 Jul 2026

Press Role guards called frappe.get_doc("Team", ...) just to call is_team_owner()/is_admin_user(), loading every row of team_members, discounts, and other children. Extracted these methods to use direct DB queries, cutting cost and eliminating N+1s.