2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00
InvenTree/InvenTree/plugin/builtin/action/simpleactionplugin.py
2022-05-15 23:26:46 +02:00

27 lines
674 B
Python

# -*- coding: utf-8 -*-
"""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):
print("Action plugin in action!")
def get_info(self, user, data=None):
return {
"user": user.username,
"hello": "world",
}
def get_result(self, user=None, data=None):
return True