savoirfairelinux / sous-chef

Sous-Chef is a web application to help organizations to plan and deliver meals, and to manage clients files.
GNU Affero General Public License v3.0
67 stars 45 forks source link

Client drop-list in Place orders should only display ACTIVE clients #846

Closed JeanFrancoisFournier closed 4 years ago

JeanFrancoisFournier commented 4 years ago

Expected Behaviour

Drop-down list should only display active clients in order generation UI form, thus preventing user from creating an order for a paused, stopped or deceased clients.

Actual Behaviour

The list shows all clients regardless of status. This may cause mistakes when a PAUSED client calls and places an order. If the user doesn't check their status manually, they still can find them in the drop-list and create the order but the kitchen count won't take that order into account since only orders for active clients are processed by the kitchen count.

Steps to reproduce

guillaumep commented 4 years ago

Look in the client query in src/order/forms.py:

        queryset=Client.objects.all().select_related(
            'member'
        ).only(
            'member__firstname',
            'member__lastname'
        )

The query should get active clients only.

guillaumep commented 4 years ago

Confirmed working in staging environment: no paused nor pending nor deceased clients are listed.

JeanFrancoisFournier commented 3 years ago

Tested on staging with real numbers and fix is confirmed! Also faster to load which is a plus!