openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.11k stars 718 forks source link

Reports not loading for enterprises who do not sell to customers directly #12865

Closed amidaOFN closed 3 weeks ago

amidaOFN commented 3 weeks ago

Description

Enterprises who supply only to hub shops - i.e. their enterprise setting for 'sells' is set to 'None' and their products are sold only through a hub shop - cannot load any reports.

Whether using only one filter parameter, including only date range or no filters, user reports the screen just reloads to empty filters and does not produce a report onscreen, for download, or by email.

Admin has replicated this when logged into the users account, but can load reports normally when in admin or another producer account.

Expected Behavior

Reports should be loaded regardless of account type.

Actual Behaviour

Reports do not load at all, screen refreshes to the initial report filters screen, with empty filter fields.

Steps to Reproduce

  1. Log in to a 'supplier only' account where the 'Sells' setting is set to 'none'.
  2. Attempt to load a report such as Pack by Customer or Order Cycle Customer Totals, with and without report filters.
  3. See that the report does not load, but refreshes to blank reports screen.
  4. Animated Gif/Screenshot

Workaround

Change the 'Sells' setting to 'Own'

Severity

S3

https://github.com/openfoodfoundation/openfoodnetwork/wiki/Bug-severity -->

Your Environment

Bug is not environment dependent but depends on the type of user account

Possible Fix

RachL commented 3 weeks ago

Hi @amidaOFN I think this is the same as https://github.com/openfoodfoundation/openfoodnetwork/issues/12835 for which there is a PR is testing, so I'm closing this one but please reopen if I got it wrong!