InvenTree/InvenTree/order
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
..
fixtures Add Metadata to more models (#4898) 2023-06-02 19:26:20 +10:00
migrations Update django money / py-moneyed dependencies (#5778) 2023-10-31 22:19:55 +11:00
templates/order Build order improvements (#6343) 2024-01-29 10:56:34 +11:00
__init__.py Docstring checks in QC checks (#3089) 2022-06-02 01:37:39 +10:00
admin.py Import Fix (#6274) 2024-01-18 17:25:25 +11:00
api.py Bump to Dj 4.x (#6173) 2024-02-06 13:30:50 +11:00
apps.py [CI] docstrings (#6172) 2024-01-11 14:40:07 +11:00
forms.py [CI] Enable python autoformat (#6169) 2024-01-11 11:28:58 +11:00
models.py [Plugin] Enhanced custom validation (#6410) 2024-02-06 22:00:22 +11:00
serializers.py Allow orders' creation date edit via API (#6178) 2024-02-04 20:09:17 +11:00
tasks.py [CI] docstrings (#6172) 2024-01-11 14:40:07 +11:00
test_api.py Bump to Dj 4.x (#6173) 2024-02-06 13:30:50 +11:00
test_migrations.py [CI] Enable python autoformat (#6169) 2024-01-11 11:28:58 +11:00
test_sales_order.py [CI] docstrings (#6172) 2024-01-11 14:40:07 +11:00
test_views.py Bump to Dj 4.x (#6173) 2024-02-06 13:30:50 +11:00
tests.py [CI] docstrings (#6172) 2024-01-11 14:40:07 +11:00
urls.py Move more paths to basic path (#6251) 2024-01-18 17:05:10 +11:00
validators.py [CI] docstrings (#6172) 2024-01-11 14:40:07 +11:00
views.py [CI] docstrings (#6172) 2024-01-11 14:40:07 +11:00