mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-05 13:10:57 +00:00
Separated category from part permissions and location from stock item permissions
This commit is contained in:
@ -73,7 +73,7 @@ class StockLocationDetail(InvenTreeRoleMixin, DetailView):
|
||||
template_name = 'stock/location.html'
|
||||
queryset = StockLocation.objects.all()
|
||||
model = StockLocation
|
||||
role_required = 'stock.view'
|
||||
role_required = ['stock_location.view', 'stock.view']
|
||||
|
||||
|
||||
class StockItemDetail(InvenTreeRoleMixin, DetailView):
|
||||
@ -121,7 +121,7 @@ class StockLocationEdit(AjaxUpdateView):
|
||||
context_object_name = 'location'
|
||||
ajax_template_name = 'modal_form.html'
|
||||
ajax_form_title = _('Edit Stock Location')
|
||||
role_required = 'stock.change'
|
||||
role_required = 'stock_location.change'
|
||||
|
||||
def get_form(self):
|
||||
""" Customize form data for StockLocation editing.
|
||||
@ -146,7 +146,7 @@ class StockLocationQRCode(QRCodeView):
|
||||
""" View for displaying a QR code for a StockLocation object """
|
||||
|
||||
ajax_form_title = _("Stock Location QR code")
|
||||
role_required = 'stock.view'
|
||||
role_required = ['stock_location.view', 'stock.view']
|
||||
|
||||
def get_qr_data(self):
|
||||
""" Generate QR code data for the StockLocation """
|
||||
@ -1361,7 +1361,7 @@ class StockLocationCreate(AjaxCreateView):
|
||||
context_object_name = 'location'
|
||||
ajax_template_name = 'modal_form.html'
|
||||
ajax_form_title = _('Create new Stock Location')
|
||||
role_required = 'stock.add'
|
||||
role_required = 'stock_location.add'
|
||||
|
||||
def get_initial(self):
|
||||
initials = super(StockLocationCreate, self).get_initial().copy()
|
||||
@ -1748,7 +1748,7 @@ class StockLocationDelete(AjaxDeleteView):
|
||||
ajax_template_name = 'stock/location_delete.html'
|
||||
context_object_name = 'location'
|
||||
ajax_form_title = _('Delete Stock Location')
|
||||
role_required = 'stock.delete'
|
||||
role_required = 'stock_location.delete'
|
||||
|
||||
|
||||
class StockItemDelete(AjaxDeleteView):
|
||||
|
Reference in New Issue
Block a user