mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-27 17:20:49 +00:00
Single table for file attachments (#7420)
* Add basic model for handling generic attachments * Refactor migration * Data migration to convert old files across * Admin updates * Increase comment field max_length * Adjust field name * Remove legacy serializer classes / endpoints * Expose new model to API * Admin site list filters * Remove legacy attachment models - Add new mixin class to designate which models can have attachments * Update data migration - Ensure other apps are at the correct migration state beforehand * Add migrations to remove legacy attachment tables * Fix for "rename_attachment" callback * Refactor model_type field - ContentType does not allow easy API serialization * Set allowed options for admin * Update model verbose names * Fix logic for file upload * Add choices for serializer * Add API filtering * Fix for API filter * Fix for attachment tables in PUI - Still not solved permission issues * Bump API version * Record user when uploading attachment via API * Refactor <AttachmentTable /> for PUI * Display 'file_size' in PUI attachment table * Fix company migrations * Include permission informtion in roles API endpoint * Read user permissions in PUI * Simplify permission checks for <AttachmentTable /> * Automatically clean up old content types * Cleanup PUI * Fix typo in data migration * Add reverse data migration * Update unit tests * Use InMemoryStorage for media files in test mode * Data migration unit test * Fix "model_type" field - It is a required field after all * Add permission check for serializer * Fix permission check for CUI * Fix PUI import * Test python lib against specific branch - Will be reverted once code is merged * Revert STORAGES setting - Might be worth looking into again * Fix part unit test * Fix unit test for sales order * Use 'get_global_setting' * Use 'get_global_setting' * Update setting getter * Unit tests * Tweaks * Revert change to settings.py * More updates for get_global_setting * Relax API query count requirement * remove illegal chars and add unit tests * Fix unit tests * Fix frontend unit tests * settings management updates * Prevent db write under more conditions * Simplify settings code * Pop values before creating filters * Prevent settings write under certain conditions * Add debug msg * Clear db on record import * Refactor permissions checks - Allows extension / customization of permission checks at a later date * Unit test updates * Prevent delete of attachment without correct permissions * Adjust odcker.yaml * Cleanup data migrations * Tweak migration tests for build app * Update data migration - Handle case with missing data * Prevent debug shell in TESTING mode * Update migration dependencies - Ensure all apps are "up to date" before removing legacy tables * add file size test * Update migration tests * Revert some settings caching changes * Fix incorrect logic in migration * Update unit tests * Prevent create on CURRENCY_CODES - Seems to play havoc with bootup sequence * Fix unit test * Some refactoring - Use get_global_setting * Fix typo * Revert change * Add "tags" and "metadata" * Include "tags" field in API serializer * add "metadata" endpoint for attachments
This commit is contained in:
.github
src
backend
InvenTree
InvenTree
api.pyapi_version.pyexchange.pyfields.pymiddleware.pymodels.pyserializers.pysettings.pyunit_test.pyvalidators.pyversion.py
build
api.pytest_migrations.py
migrations
0022_buildorderattachment.py0027_auto_20210404_2016.py0033_auto_20211128_0151.py0051_delete_buildorderattachment.py
models.pyserializers.pytemplates
build
common
admin.pyapi.pycurrency.py
migrations
models.pyserializers.pysettings.pytest_migrations.pytest_views.pytests.pyvalidators.pycompany
admin.pyapi.py
migrations
0001_initial.py0023_auto_20200808_0715.py0034_manufacturerpart.py0041_alter_company_options.py0043_manufacturerpartattachment.py0054_companyattachment.py0070_remove_manufacturerpartattachment_manufacturer_part_and_more.py
models.pyserializers.pytemplates
test_migrations.pyorder
api.py
migrations
0016_purchaseorderattachment.py0020_auto_20200420_0940.py0044_auto_20210404_2016.py0053_auto_20211128_0151.py0081_auto_20230314_0725.py0100_remove_returnorderattachment_order_and_more.py
models.pyserializers.pytemplates
test_api.pypart
admin.pyapi.pytest_api.py
migrations
0032_auto_20200322_0453.py0064_auto_20210404_2016.py0075_auto_20211128_0151.py0124_delete_partattachment.py
models.pyserializers.pytemplates
part
plugin
report
stock
admin.pyapi.pytest_api.py
migrations
0036_stockitemattachment.py0059_auto_20210404_2016.py0070_auto_20211128_0151.py0111_delete_stockitemattachment.py
models.pyserializers.pytemplates
stock
templates
js
translated
users
frontend
src
defaults
enums
pages
Index
build
company
part
purchasing
sales
stock
states
tables
tests
pages
1
tasks.py
1
tasks.py
@ -462,6 +462,7 @@ def migrate(c):
|
||||
manage(c, 'makemigrations')
|
||||
manage(c, 'runmigrations', pty=True)
|
||||
manage(c, 'migrate --run-syncdb')
|
||||
manage(c, 'remove_stale_contenttypes --include-stale-apps --no-input', pty=True)
|
||||
|
||||
print('========================================')
|
||||
print('InvenTree database migrations completed!')
|
||||
|
Reference in New Issue
Block a user