Skip to content

Commit

Permalink
Generate placeholder panel
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Oct 19, 2024
1 parent d489a94 commit 3ed7066
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions order_history/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,50 @@ class OrderHistoryPlugin(SettingsMixin, UrlsMixin, UserInterfaceMixin, InvenTree
TITLE = "Order History Plugin"

SETTINGS = {
# TODO: Fill out settings
'BUILD_ORDER_HISTORY': {
'name': 'Build Order History',
'description': 'Enable build order history tracking',
'default': True,
'validator': bool,
},
'PURCHASE_ORDER_HISTORY': {
'name': 'Purchase Order History',
'description': 'Enable purchase order history tracking',
'default': True,
'validator': bool,
},
'SALES_ORDER_HISTORY': {
'name': 'Sales Order History',
'description': 'Enable sales order history tracking',
'default': True,
'validator': bool,
},
'RETURN_ORDER_HISTORY': {
'name': 'Return Order History',
'description': 'Enable return order history tracking',
'default': True,
'validator': bool,
},
}

def get_ui_panels(self, request, context=None, **kwargs):
"""Return a list of UI panels to be rendered in the InvenTree user interface."""

print("get_ui_panels:", context)
target = context.get('target_model')

if target == 'part':
return [
{
'key': 'order-history',
'title': 'Order History',
'description': 'View order history for this part',
'source': self.plugin_static_file(
'OrderHistoryPanel.js:renderPanel'
),
'context': {
'settings': self.get_settings_dict(),
}
}
]

return []

0 comments on commit 3ed7066

Please sign in to comment.