2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

Filter StockItem API by staleness

This commit is contained in:
Oliver Walters
2021-01-06 22:20:54 +11:00
parent 33d6396a4e
commit ba915da22b
5 changed files with 86 additions and 29 deletions

View File

@ -27,7 +27,7 @@ from InvenTree.helpers import increment, getSetting, normalize
from InvenTree.validators import validate_build_order_reference
from InvenTree.models import InvenTreeAttachment
from common.models import InvenTreeSetting
import common.models
import InvenTree.fields
@ -822,7 +822,7 @@ class Build(MPTTModel):
)
# Exclude expired stock items
if not InvenTreeSetting.get_setting('STOCK_ALLOW_EXPIRED_BUILD'):
if not common.models.InvenTreeSetting.get_setting('STOCK_ALLOW_EXPIRED_BUILD'):
items = items.exclude(StockModels.StockItem.EXPIRED_FILTER)
return items