mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-19 22:47:48 +00:00
Clean up implementation of test report matching
This commit is contained in:
1 parent
b7ae95686e
commit
c849f618d5
5 files changed
+21
-27
No files matched your search
@@ -202,6 +202,17 @@ class TestReport(ReportTemplateBase, PartFilterMixin):
|
||||
# Requires a stock_item object to be given to it before rendering
|
||||
stock_item = None
|
||||
|
||||
def matches_stock_item(self, item):
|
||||
"""
|
||||
Test if this report template matches a given StockItem objects
|
||||
"""
|
||||
|
||||
filters = validateFilterString(self.part_filters)
|
||||
|
||||
items = StockItem.objects.filter(**filters)
|
||||
|
||||
return items.exists()
|
||||
|
||||
def get_context_data(self, request):
|
||||
return {
|
||||
'stock_item': self.stock_item,
|
||||
|
||||
Reference in new issue
Block a user