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:
@ -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
|
||||
|
Reference in New Issue
Block a user