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 %} +