1
0
forked from erp-dev/erp

fix: frozen excluded from stock api

This commit is contained in:
2026-02-02 19:09:06 +08:00
parent 1c630606c8
commit dee1c814b9
4 changed files with 130 additions and 0 deletions

View File

@@ -314,6 +314,8 @@ class ListStockChangeDetailsView(StockChangeViewMixin, views.APIView):
stock_change_record__type=change_type,
product_id=product_id,
consumed_by_detail__isnull=True # 仅查询未被消耗的明细
).exclude(
stock_freezes__status=stock_models.StockFreezeStatusEnum.FROZEN
).select_related(
'stock_change_record',
'product'