mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
parent
752fb97d2f
commit
c8642bedcd
@ -7,7 +7,6 @@ import sys
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from django.core.exceptions import FieldError, ValidationError
|
|
||||||
from django.core.validators import FileExtensionValidator
|
from django.core.validators import FileExtensionValidator
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.template import Context, Template
|
from django.template import Context, Template
|
||||||
@ -304,19 +303,6 @@ class TestReport(ReportTemplateBase):
|
|||||||
help_text=_('Include test results for stock items installed inside assembled item')
|
help_text=_('Include test results for stock items installed inside assembled item')
|
||||||
)
|
)
|
||||||
|
|
||||||
def matches_stock_item(self, item):
|
|
||||||
"""Test if this report template matches a given StockItem objects."""
|
|
||||||
try:
|
|
||||||
filters = validateFilterString(self.filters)
|
|
||||||
items = stock.models.StockItem.objects.filter(**filters)
|
|
||||||
except (ValidationError, FieldError):
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Ensure the provided StockItem object matches the filters
|
|
||||||
items = items.filter(pk=item.pk)
|
|
||||||
|
|
||||||
return items.exists()
|
|
||||||
|
|
||||||
def get_test_keys(self, stock_item):
|
def get_test_keys(self, stock_item):
|
||||||
"""Construct a flattened list of test 'keys' for this StockItem:
|
"""Construct a flattened list of test 'keys' for this StockItem:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user