Skip to content

Commit

Permalink
Remove references to old setting
Browse files Browse the repository at this point in the history
- Now offloaded to plugins
  • Loading branch information
SchrodingersGat committed Aug 28, 2024
1 parent d5e8227 commit 0ee8560
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
8 changes: 0 additions & 8 deletions src/backend/InvenTree/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1710,14 +1710,6 @@ def save(self, *args, **kwargs):
'default': True,
'validator': bool,
},
'REPORT_ATTACH_TEST_REPORT': {
'name': _('Attach Test Reports'),
'description': _(
'When printing a Test Report, attach a copy of the Test Report to the associated Stock Item'
),
'default': False,
'validator': bool,
},
'SERIAL_NUMBER_GLOBALLY_UNIQUE': {
'name': _('Globally Unique Serials'),
'description': _('Serial numbers for stock items must be globally unique'),
Expand Down
18 changes: 0 additions & 18 deletions src/backend/InvenTree/report/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,24 +580,6 @@ def test_print(self):
Attachment.objects.filter(model_id=item.pk, model_type='stockitem').exists()
)

return
# TODO @matmair - Re-add this test after https://github.com/inventree/InvenTree/pull/7074/files#r1600694356 is resolved
# Change the setting, now the test report should be attached automatically
InvenTreeSetting.set_setting('REPORT_ATTACH_TEST_REPORT', True, None)

response = self.post(
url, {'template': template.pk, 'items': [item.pk]}, expected_code=201
)

# There should be a link to the generated PDF
self.assertEqual(response.data['output'].startswith('/media/report/'), True)

# Check that a report has been uploaded
attachment = Attachment.objects.filter(
model_id=item.pk, model_type='stockitem'
).first()
self.assertIsNotNone(attachment)

def test_mdl_build(self):
"""Test the Build model."""
self.run_print_test(Build, 'build', label=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
{% include "InvenTree/settings/setting.html" with key="REPORT_DEBUG_MODE" icon="fa-laptop-code" %}
{% include "InvenTree/settings/setting.html" with key="REPORT_LOG_ERRORS" icon="fa-exclamation-circle" %}
{% include "InvenTree/settings/setting.html" with key="REPORT_ENABLE_TEST_REPORT" icon="fa-vial" %}
{% include "InvenTree/settings/setting.html" with key="REPORT_ATTACH_TEST_REPORT" icon="fa-file-upload" %}
</tbody>
</table>

Expand Down
3 changes: 1 addition & 2 deletions src/frontend/src/pages/Index/Settings/SystemSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ export default function SystemSettings() {
'REPORT_DEFAULT_PAGE_SIZE',
'REPORT_DEBUG_MODE',
'REPORT_LOG_ERRORS',
'REPORT_ENABLE_TEST_REPORT',
'REPORT_ATTACH_TEST_REPORT'
'REPORT_ENABLE_TEST_REPORT'
]}
/>
)
Expand Down

0 comments on commit 0ee8560

Please sign in to comment.