2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Adds a new InvenTreePluginMixin mixin class for enabling custom plugin rendering on a page

- Any view which needs custom plugin code must implement this mixin
- Initially implement for the PartDetail page
This commit is contained in:
Oliver Walters
2022-05-06 22:52:52 +10:00
parent 7b8a10173d
commit c80b36fc2f
8 changed files with 74 additions and 10 deletions

View File

@ -46,9 +46,6 @@ class CustomPanelSample(PanelMixin, IntegrationPluginBase):
# This panel will *only* display on the StockLocation view,
# and *only* if the StockLocation has *no* child locations
if isinstance(view, StockLocationDetail):
print("yep, stocklocation view!")
try:
loc = view.get_object()
@ -58,11 +55,7 @@ class CustomPanelSample(PanelMixin, IntegrationPluginBase):
'icon': 'fa-user',
'content': '<h4>I have no children!</h4>'
})
else:
print("abcdefgh")
except:
print("error could not get object!")
pass
return panels