From 2a3b7a0900e3c237e127ca078fc82e02056ad151 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 21 Jun 2022 08:11:42 +0200 Subject: [PATCH] add Transfers to lot dropdown --- ereuse_devicehub/resources/lot/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/lot/views.py b/ereuse_devicehub/resources/lot/views.py index 117d3209..cb160317 100644 --- a/ereuse_devicehub/resources/lot/views.py +++ b/ereuse_devicehub/resources/lot/views.py @@ -141,7 +141,12 @@ class LotView(View): # temporary if lot_type == "temporary": - return query.filter(Lot.trade == None).filter(Lot.transfer == None) + return query.filter(Lot.trade == None).filter( + or_( + Lot.transfer == None, + Transfer.date == None + ) + ) if lot_type == "incoming": return query.filter(