2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-03 04:00:57 +00:00

[plugin] Auto issue orders (#9565)

* Add builtin plugin for auto-issuing orders

* Add plugin to auto-issue orders

* Add placeholder documentation

* Fix typo

* Adds image macro

- To replace img.html
- includes checking if file exists

* Fix tooltips

* More docs

* Adjust plugin settings filters

* docs

* More docs

* More docs

* Updates

* Less restrictive URL checking

* Refactor build order page

* Fix typo

* Allow 429

* Debug output

* More debug

* Construct assets dir

* Cleanup

* Update docs README

* Refactoring more pages

* Fix image link

* Fix SSO settings

* Add hook to check for missing settings

- Ensure that all settings are documented!

* Add missing user settings

* Update docstring

* Tweak SSO.md

* Image updates

* More updates

* Tweaks

* Exclude orders without a target_date

* Fix for issuing build orders

* Further refactoring

* Fixes

* Image refactoring

* More refactoring

* More refactoring

* Refactor app images

* Fix pathing issues

* Suppress some openapidocs warnings in logs

(much easier to debug docs build issues)

* Fix image reference

* Reduce error messages

* Fix image links

* Fix image links

* Reduce docs log output

* Ensure settings are loaded before displaying them

* Fix for UI test

* Fix unit test

* Test tweaks
This commit is contained in:
Oliver
2025-06-03 17:07:12 +10:00
committed by GitHub
parent 89f8f132e1
commit 11ab0203b1
124 changed files with 1178 additions and 957 deletions

View File

@ -258,3 +258,52 @@ def on_config(config, *args, **kwargs):
config['releases'] = sorted(releases, key=lambda it: it['date'], reverse=True)
return config
def on_post_build(*args, **kwargs):
"""Run after the build is complete.
Here we check that all global settings and user settings are documented.
"""
here = Path(__file__).parent
gen_base = here.parent.joinpath('generated')
expected_settings_file = gen_base.joinpath('inventree_settings.json')
observed_settings_file = gen_base.joinpath('observed_settings.json')
with open(observed_settings_file, encoding='utf-8') as f:
observed_settings = json.loads(f.read())
with open(expected_settings_file, encoding='utf-8') as f:
expected_settings = json.loads(f.read())
ignored_settings = {
'global': ['SERVER_RESTART_REQUIRED'],
'user': ['LAST_USED_PRINTING_MACHINES'],
}
for group in ['global', 'user']:
expected = expected_settings.get(group, {})
observed = observed_settings.get(group, {})
ignored = ignored_settings.get(group, [])
missing = []
for key in expected:
if key.startswith('_'):
# Ignore internal settings
continue
if key in ignored:
# Ignore settings that are not relevant
continue
if key not in observed:
missing.append(key)
if missing:
raise NotImplementedError(
'Missing Settings:\n'
+ f"There are {len(missing)} missing settings in the '{group}' group:\n"
+ '\n- '.join(missing)
)