mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Bump to Dj 4.x (#6173)
* bump to dj >4.2 * switch to experimental git release * bump django-import_export * bump mptt * replace is_ajax, which was removed https://docs.djangoproject.com/en/3.1/releases/3.1/#id2 * Save before accessing values in m2m/fk fields * move plugin init * use dev version of django for fix * update deps * fix deps * use django smaller 4.2 * fix reqs * fix merge * remove moved code * another merge fix * fix ajax call * fix refs * change python min v * fix deps * bump deps * fix deps * pin pillow * dj 4.1 upgrades * make diff smaller * bump all deps * drop down to py3.9 * bump versions * merge fix * fix diff * more bumping * diff cleanup * bump deps * fix reqs * use accurate state for model migrations using apps the historically correct state is used * try import * added more logs * add try here too * clean up rebuilds * Dj 4.2 (#161) * autochanges * bump * fix diff * fix diff * bump deps * fix req * remove select_related to test error influence * switch to mptt fork * fix reqs for upstream * move tracking ensureance into save * optimize check frequency * use psycopg instead of psycopg2 * fix header * just use the values * switch to dj < 4.2 * fix req * another req fix * switch to 4.2 again * fix merge error * Check for null pk in calculate_total_price Cannot access self.lines if pk is Null * use patched mptt * try psycopg2 again * Remove tree rebuild from migrations * Prevent notify_users if importing or migrating * Add order_by() to subquery annotations - Ref: https://stackoverflow.com/a/629691 * Update stock filters - Append order_by() * fix error if running without timezones in testing * add logging to figure this out * remove tz from self.creation if TZ is off * add tz? * move around? * only run the test i am trying to figure out not reproducible on my machine * only run the test i am trying to figure out not reproducible on my machine * run all tests again --------- Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
		| @@ -51,6 +51,7 @@ class BuildResource(InvenTreeResource): | ||||
|     notes = Field(attribute='notes') | ||||
|  | ||||
|  | ||||
| @admin.register(Build) | ||||
| class BuildAdmin(ImportExportModelAdmin): | ||||
|     """Class for managing the Build model via the admin interface""" | ||||
|  | ||||
| @@ -83,6 +84,7 @@ class BuildAdmin(ImportExportModelAdmin): | ||||
|     ] | ||||
|  | ||||
|  | ||||
| @admin.register(BuildItem) | ||||
| class BuildItemAdmin(admin.ModelAdmin): | ||||
|     """Class for managing the BuildItem model via the admin interface.""" | ||||
|  | ||||
| @@ -98,6 +100,7 @@ class BuildItemAdmin(admin.ModelAdmin): | ||||
|     ] | ||||
|  | ||||
|  | ||||
| @admin.register(BuildLine) | ||||
| class BuildLineAdmin(admin.ModelAdmin): | ||||
|     """Class for managing the BuildLine model via the admin interface""" | ||||
|  | ||||
| @@ -112,8 +115,3 @@ class BuildLineAdmin(admin.ModelAdmin): | ||||
|         'build__reference', | ||||
|         'bom_item__sub_part__name', | ||||
|     ] | ||||
|  | ||||
|  | ||||
| admin.site.register(Build, BuildAdmin) | ||||
| admin.site.register(BuildItem, BuildItemAdmin) | ||||
| admin.site.register(BuildLine, BuildLineAdmin) | ||||
|   | ||||
| @@ -3,12 +3,6 @@ | ||||
| from django.db import migrations, models | ||||
| import django.db.models.deletion | ||||
| import mptt.fields | ||||
| from build.models import Build | ||||
|  | ||||
|  | ||||
| def update_tree(apps, schema_editor): | ||||
|     # Update the Build MPTT model | ||||
|     Build.objects.rebuild() | ||||
|  | ||||
|  | ||||
| class Migration(migrations.Migration): | ||||
| @@ -49,5 +43,4 @@ class Migration(migrations.Migration): | ||||
|             field=models.PositiveIntegerField(db_index=True, default=0, editable=False), | ||||
|             preserve_default=False, | ||||
|         ), | ||||
|         migrations.RunPython(update_tree, reverse_code=migrations.RunPython.noop), | ||||
|     ] | ||||
|   | ||||
| @@ -57,6 +57,4 @@ class Migration(migrations.Migration): | ||||
|         ('build', '0028_builditem_bom_item'), | ||||
|     ] | ||||
|  | ||||
|     operations = [ | ||||
|         migrations.RunPython(assign_bom_items, reverse_code=migrations.RunPython.noop), | ||||
|     ] | ||||
|     operations = [] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user