2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00
Files
InvenTree/InvenTree/plugin/builtin/action/simpleactionplugin.py
2022-05-29 03:17:11 +02:00

27 lines
726 B
Python

"""Sample implementation for ActionMixin."""
from plugin import InvenTreePlugin
from plugin.mixins import ActionMixin
class SimpleActionPlugin(ActionMixin, InvenTreePlugin):
"""An EXTREMELY simple action plugin which demonstrates the capability of the ActionMixin class."""
NAME = "SimpleActionPlugin"
ACTION_NAME = "simple"
def perform_action(self, user=None, data=None):
"""Sample method."""
print("Action plugin in action!")
def get_info(self, user, data=None):
"""Sample method."""
return {
"user": user.username,
"hello": "world",
}
def get_result(self, user=None, data=None):
"""Sample method."""
return True