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(