Long & Short

This commit is contained in:
2026-07-28 20:50:46 +02:00
parent aaa1490389
commit 03c294ad8c

View File

@@ -419,7 +419,7 @@ class CTRMLongShortMixin:
def _physical_quantity_query(cls, lot, line_field):
return lot.select(
getattr(lot, line_field).as_('line'),
Sum(Coalesce(lot.lot_quantity, 0)).as_('quantity'),
Sum(Coalesce(lot.lot_qt, 0)).as_('quantity'),
where=((lot.lot_type == 'physic')
& (getattr(lot, line_field) != Null)),
group_by=[getattr(lot, line_field)])