From 44239cba081fd3afbce3401fed6721898e25c15d Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 30 Mar 2022 01:30:32 +0200 Subject: [PATCH] hide delete button --- InvenTree/company/admin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/InvenTree/company/admin.py b/InvenTree/company/admin.py index af78e76a7f..6412aff934 100644 --- a/InvenTree/company/admin.py +++ b/InvenTree/company/admin.py @@ -40,6 +40,11 @@ class CompanyAdmin(ImportExportModelAdmin): exclude = ('is_deleted',) + def has_delete_permission(self, request, obj=None): + if obj and obj.is_deleted: + return False + return True + class SupplierPartResource(ModelResource): """