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

Add a button if a stock item test report is available

This commit is contained in:
Oliver Walters
2020-05-22 21:38:05 +10:00
parent 1ad7e699a9
commit 71681bfda1
3 changed files with 12 additions and 1 deletions

View File

@ -372,6 +372,11 @@ class Part(MPTTModel):
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})