From 65046df4173ae889002cf839e6b35cfdfdfb8d02 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 12 Nov 2021 00:00:43 +0100 Subject: [PATCH] display path in plugin details Fixes #2294 --- InvenTree/plugin/integration.py | 8 ++++++++ .../templates/InvenTree/settings/plugin_settings.html | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/InvenTree/plugin/integration.py b/InvenTree/plugin/integration.py index 1b8b70e3bd..181576732c 100644 --- a/InvenTree/plugin/integration.py +++ b/InvenTree/plugin/integration.py @@ -6,6 +6,7 @@ import os import subprocess import inspect from datetime import datetime +import pathlib from django.conf.urls import url, include from django.conf import settings @@ -337,6 +338,13 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin): name = getattr(self, 'WEBSITE', None) return name + @property + def package_path(self): + """returns the path to the plugin""" + if self._is_package: + return self.__module__ + return pathlib.Path(self.def_path).relative_to(settings.BASE_DIR) + # mixins def mixin(self, key): """check if mixin is registered""" diff --git a/InvenTree/templates/InvenTree/settings/plugin_settings.html b/InvenTree/templates/InvenTree/settings/plugin_settings.html index c9ee40ffd9..e78e2f204a 100644 --- a/InvenTree/templates/InvenTree/settings/plugin_settings.html +++ b/InvenTree/templates/InvenTree/settings/plugin_settings.html @@ -71,6 +71,11 @@ {% endif %} + + + {% trans "Installation path" %} + {{ plugin.package_path }} + {% if plugin.is_package == False %}