Replies: 1 comment 1 reply
-
|
Sound like a sound approach; not sure if ExportMixin will help with the overall goal. Getting 4 into core sounds very far fetched for a brand new contributor. That has to be a sounds implementation with documentation to be accepted. Not having it in core means it would be far easier to just patch full core functionality, there is not much difference in the required merge flows. If the result is not open source the free consulting by myself ends with this post. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I want to add a new attribute "is_returnable" to part. I decided do it through plugins to avoid any change in core code of inventree. After analysing a bit this is what i found.
Backend changes :
Model Meta Data / App Mixin new table -> for storing is_returnable
Separate api endpoint -> Url Mixin to update its value
Event Mixin - To know which part is added / updated / deleted and perform whats needed
Export Mixin - For adding the is_returnable column in excel sheet while downloading parts list
Validation Mixin - For throwing error in return order creation, if is_returnable is false
Frontend solutions :
Separate Ui Panels ( Given inventree solution for Ui ) - Can’t use in existing UI like putting in the part form itself. No point in having such an option separetly.
Direct Dom manipulation - Not feasible for dynamic react components.
Copy Entire Ui - Duplicate the entire ui of add part from core code and put in plugin and make it so that on click of add part btn it opens our form instead of its own. Hard to maintain and Complex change. Will have core change but minimal, i guess. Problem when the core inventee ui/logic changes and keeping the plugin up to date. May have unknowns if something isn't exposed to plugin in the back and forth communication.
Create new Mixins for specific places in ui - New mixin that adds a field in the part create/edit form and similarly for part details / search filters. I doubt that a generic code will be able to handle for any place we want to add a new ui to. It will be like creating a new mixin like "Core Ui Mixin" that I can keep extending according to my need. But this will have core changes.
To me only the 4th solution seems viable or if it doesn't work for some reason fallback to 3rd.
Questions :
Is the solution I am thinking off is viable or I am missing something ?
Has anyone encountered such an issue while creating similar plugins ?
Is a Mixin for changing core inventree ui in plans or needed ?
Is this even achievable through a plugin ?
Thanks.
Doc Links :
Available UI Feature Types :
Spotlight Actions
Dashboard Items
Panels
Template Editors
Template previews
UI Mixins - https://docs.inventree.org/en/stable/plugins/mixins/ui/
Template Editor - https://docs.inventree.org/en/1.1.x/report/template_editor/
All Available Plugin Mixins - https://docs.inventree.org/en/stable/plugins/develop/#plugin-mixins
Beta Was this translation helpful? Give feedback.
All reactions