|
@@ -89,7 +89,7 @@ class CategoryAdmin(StockMixin, MPTTModelAdmin):
|
|
|
class LocationAdmin(StockMixin, admin.ModelAdmin):
|
|
|
def has_delete_permission(self, request, obj=None):
|
|
|
# Interdiction de supprimer l’emplacement si il contient des équipements
|
|
|
- return obj and not obj.equipment_set.exists()
|
|
|
+ return obj and not obj.equipments.exists()
|
|
|
|
|
|
|
|
|
#class EquipmentAdmin(admin.ModelAdmin):
|