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

Add setting to disable IPN editing after part is created (web only)

This commit is contained in:
eeintech
2021-03-12 10:30:31 -05:00
parent ed028aed62
commit b152f7041b
3 changed files with 14 additions and 0 deletions

View File

@ -910,6 +910,12 @@ class PartEdit(AjaxUpdateView):
form.fields['default_supplier'].queryset = SupplierPart.objects.filter(part=part)
# Check if IPN can be edited
ipn_edit_enable = InvenTreeSetting.get_setting('PART_ALLOW_EDIT_IPN')
if not ipn_edit_enable and not self.request.user.is_superuser:
# Admin can still change IPN
form.fields['IPN'].disabled = True
return form