2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00
Oliver 2b9816d1a3
[Plugin] Enhanced custom validation (#6410)
* Use registry.get_plugin()

- Instead of registry.plugins.get()
- get_plugin checks registry hash
- performs registry reload if necessary

* Add PluginValidationMixin class

- Allows the entire model to be validated via plugins
- Called on model.full_clean()
- Called on model.save()

* Update Validation sample plugin

* Fix for InvenTreeTree models

* Refactor build.models

- Expose models to plugin validation

* Update stock.models

* Update more models

- common.models
- company.models

* Update more models

- label.models
- order.models
- part.models

* More model updates

* Update docs

* Fix for potential plugin edge case

- plugin slug is globally unique
- do not use get_or_create with two lookup fields
- will throw an IntegrityError if you change the name of a plugin

* Inherit DiffMixin into PluginValidationMixin

- Allows us to pass model diffs through to validation
- Plugins can validate based on what has *changed*

* Update documentation

* Add get_plugin_config helper function

* Bug fix

* Bug fix

* Update plugin hash when calling set_plugin_state

* Working on unit testing

* More unit testing

* Move get_plugin_config into registry.py

* Move extract_int into InvenTree.helpers

* Fix log formatting

* Update model definitions

- Ensure there are no changes to the migrations

* Comment out format line

* Fix access to get_plugin_config

* Fix tests for SimpleActionPlugin

* More unit test fixes
2024-02-06 22:00:22 +11:00
..
2023-12-14 11:13:50 +11:00
2024-02-03 22:51:29 +11:00
2023-10-18 07:27:28 +11:00
2023-11-21 14:53:45 +11:00
2024-01-20 15:31:17 +11:00
2024-02-03 22:51:29 +11:00
2023-10-18 07:27:28 +11:00
2023-04-22 23:35:25 +10:00
2023-04-22 22:40:29 +10:00
2024-01-17 12:36:24 +11:00
2023-04-27 22:27:21 +10:00
2024-01-11 14:40:07 +11:00
2023-04-22 22:40:29 +10:00
2023-04-22 22:40:29 +10:00