fix: hide warning that shouldn't be displayed

This commit is contained in:
imperosol committed 2026-11-06 13:22:05 +01:00
1 parent 9b38d4bff0
commit c33ec9bff9
2 files changed
+13 -8

No files matched your search

+3
View File
@@ -181,6 +181,9 @@ class ProductEditView(CounterAdminTabsMixin, PermissionRequiredMixin, UpdateView
permission_required = "counter.change_product"
def has_permission(self):
# If users can see products but not edit them,
# still show them this form, as it is the place where all infos are,
# but forbid to save it.
return self.request.user.has_perm("counter.change_product") or (
self.request.method == "GET"
and self.request.user.has_perm("counter.view_product")