﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31305	FieldError when doing batch update from the list view.	Ciske Boekelo	nobody	"I'm getting a FieldError when the following conditions are met:
- I'm in the admin, looking at a list view
- in the ModelAdmin, I've overridden get_queryset() to add an annotation (a Sum operation) before returning the queryset
- ***I've sorted the view by this annotation column.***
- I have selected a few items
- I perform a batch action
- in the batch action I do a batch update with queryset.update()

I get this error:

Internal Server Error: /admin/.../

FieldError at /admin/.../
Cannot resolve keyword 'x' into field. Choices are: y, z, ...

Request Method: POST
Request URL: https://host.com/admin/.../?o=-6
Django Version: 2.1
Python Executable: /usr/bin/python3
Python Version: 3.6.9


Column -6 in the URL being the annotation column.


I do NOT get an error when all conditions are the same, except I haven't sorted by the annotation column."	Bug	closed	contrib.admin	2.1	Normal	duplicate	FieldError annotation batch update admin		Unreviewed	0	0	0	0	0	0
