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:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user