2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 22:06:28 +00:00

Merge branch 'master' of git://github.com/inventree/InvenTree into bom_export_parameter_stock

This commit is contained in:
eeintech
2020-08-25 15:59:58 -05:00
24 changed files with 472 additions and 334 deletions

View File

@ -51,7 +51,8 @@ class PartResource(ModelResource):
report_skipped = False
clean_model_instances = True
exclude = [
'bom_checksum', 'bom_checked_by', 'bom_checked_date'
'bom_checksum', 'bom_checked_by', 'bom_checked_date',
'lft', 'rght', 'tree_id', 'level',
]
def get_queryset(self):

View File

@ -41,7 +41,6 @@ from InvenTree.helpers import decimal2string, normalize
from InvenTree.status_codes import BuildStatus, PurchaseOrderStatus
from report import models as ReportModels
from build import models as BuildModels
from order import models as OrderModels
from company.models import SupplierPart
@ -399,24 +398,6 @@ class Part(MPTTModel):
self.category = category
self.save()
def get_test_report_templates(self):
"""
Return all the TestReport template objects which map to this Part.
"""
templates = []
for report in ReportModels.TestReport.objects.all():
if report.matches_part(self):
templates.append(report)
return templates
def has_test_report_templates(self):
""" Return True if this part has a TestReport defined """
return len(self.get_test_report_templates()) > 0
def get_absolute_url(self):
""" Return the web URL for viewing this part """
return reverse('part-detail', kwargs={'pk': self.id})