Skip to content

feat: add Fishing Days by Organization Report (LAN-871) - #364

Open
MarcCon wants to merge 13 commits into
version-15-hotfixfrom
lan-871
Open

MarcCon wants to merge 13 commits into
version-15-hotfixfrom
lan-871

Conversation

@MarcCon

@MarcCon MarcCon commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was found.

Reviews (5) · Last reviewed commit: "fix: limit regional users to their own c..." · Reviewed by Greptile

@MarcCon

MarcCon commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

@barredterra Can you check the permissons for the requirement: "Der Bericht ist nur ab Ebene Regionlaverband aufwärts sichtbar / nutzbar"

@MarcCon
MarcCon requested a review from barredterra October 13, 2026 08:20

@barredterra barredterra left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the report is small and easy to read. Filters, approved-only fishing days summed per organization, and visibility for regional and state roles all match the ticket. A few points:

Should fix

  1. Clubs that have local groups can't be picked in the Organization filter (fishing_days_by_organization.js). The filter only offers organizations with is_group: 0. A club that has local groups below it is a group itself, so it is excluded. Catch Log Entry puts no such limit on its organization field, so entries can be booked on such a club. These clubs then appear when the filter is empty, but you can't select them. Suggestion: drop the get_query, or limit it to the user's own regional association, as water_body_development.js does with frappe.boot.landa.regional_organization.

  2. The test was removed (refactor: remove test file). It covered both the per-organization totals and the regional restriction, which is the security requirement of the ticket. Unless there was a specific reason, please bring it back, perhaps with test data that matches the fixtures.

Worth checking

  1. State employees may only see their own region. get_data filters by get_current_member_data().regional_organization regardless of role. A state employee whose member record sits under a regional association will only see that region's data. water_body_development.py does the same, so this may be intended. add_or_filters in report/utils.py skips the filter for STATE_ROLES. Which behaviour do we want here?

  2. Local groups (e.g. XXX-002-01) get their own rows instead of being added to their parent club. The ticket talks about clubs, so we should clarify whether groups should be rolled up.

Nit

  1. The join to Organization isn't needed. Catch Log Entry already stores organization_name (fetched from the organization), so entry.organization_name gives the same result.

@barredterra

Copy link
Copy Markdown
Member

One more suggestion: sort by fishing days, highest first, instead of by organization name. The purpose of the report is to see which clubs use a water body the most, so those should be at the top:

.orderby(Sum(entry.fishing_days), order=frappe.qb.desc)

The total row is not affected, and users can still sort by name in the report view.

@github-actions

Copy link
Copy Markdown

Here is a summary of the .po file changes:

  • Changed files: 1
  • Added files: 0
  • Removed files: 0
  • Files in similar change-size groups within 2% tolerance: 0
  • Added or changed translations detected: 1 across 1 file(s)

Similar Change-Size Groups

  • No repeated change-size groups were found within the 2% tolerance.
de (landa/locale/de.po) — 1 entries

de (landa/locale/de.po)

Status Msgid Previous Current
added Fishing Days by Organization empty Angeltage nach Verein

@github-actions

Copy link
Copy Markdown
landa/locale/main.pot — 1 added, 0 removed, 0 corrected

landa/locale/main.pot

Status Previous Current
added empty Fishing Days by Organization

@MarcCon
MarcCon requested a review from barredterra November 2, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants