Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch lists not sorted #2108

Open
lemoene opened this issue Jun 21, 2017 · 4 comments
Open

Batch lists not sorted #2108

lemoene opened this issue Jun 21, 2017 · 4 comments
Milestone

Comments

@lemoene
Copy link
Contributor

lemoene commented Jun 21, 2017

Keeping long lists in mind, other to the short one we see in relatively empty installations. Like ARs, Batches should by default be listed reverse chronologically new ones at the top.

Older ones are closed and fall off the active lists

Steps to reproduce

Navigate to

https://bikalims.ridingbytes.com/clients/client-1/batches

https://bikalims.ridingbytes.com/batches

Current behavior

image

Batches appear random order? I think a separate issue to the other sorting issue, seen in the demo on Tuesday but actually been around for long, see https://jira.bikalabs.com/browse/LIMS-2160

I think ALS is in order, else I would've noticed

image

Expected behavior

By default, Batch lists should be sorted like AR lists, reverse chronologically

@lemoene lemoene changed the title Client Batch list not sorted. Global Batches should be reverse chronologicalical too Batch lists not sorted Jun 21, 2017
@ramonski ramonski added this to the 3.2.1 milestone Jun 21, 2017
@mikejmets
Copy link
Contributor

I found and fixed the issue in the branch https://github.com/mikejmets/bika.lims/tree/BatchesSortOrder but test_LIMS-2076-cancelled-batches-visible-in-lists.py fails and I cannot work out what I did to make it fail.

@mikejmets
Copy link
Contributor

Tried to simulate test_LIMS-2076-cancelled-batches-visible-in-lists.py manually but I can't find a way to create a batch inside a client. No Add button appears on clients/client-1/batches whether I'm logged in as ritamo or labman1. Am I missing something?

@mikejmets
Copy link
Contributor

mikejmets commented Jun 24, 2017

Changing the sort_on in contentFilter in batchfolder makes the test_LIMS-2076-cancelled-batches-visible-in-lists.py fail in2 places:
line 82: AssertionError: B-001 was cancelled, but does not appear in ROOT cancelled batch listing
line 70: AssertionError: B-002 is active, however it does not appear ROOT default batch listing

How is this possible?

diff --git a/bika/lims/browser/batchfolder.py b/bika/lims/browser/batchfolder.py
index bdce25b..7d0b2f5 100644
--- a/bika/lims/browser/batchfolder.py
+++ b/bika/lims/browser/batchfolder.py
@@ -27,7 +27,7 @@ class BatchFolderContentsView(BikaListingView):
         self.catalog = 'bika_catalog'
         self.contentFilter = {
             'portal_type': 'Batch',
-            'sort_on': 'created',
+            'sort_on': 'BatchDate',
             'sort_order': 'reverse',
             'cancellation_state': 'active'
         }

@ramonski
Copy link
Contributor

I think this PR is also relevant for this issue: #1908

@ramonski ramonski modified the milestones: 3.2.1, 3.3.0 Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants