﻿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
29184	TabularInline read-only fields ignore ModelForm Meta.labels and help_texts	David Sanders	Danil Kozyatnikov	"Providing a `ModelForm` for `admin.TabularInline` will have any `Meta.labels` or `Meta.help_texts` overrides for read-only fields ignored. This behavior is inconsistent with `ModelAdmin` and `admin.StackedInline`, which *do* respect those overrides.

The difference in behavior comes down to the template rendering: with `TabularInline` the field names are rendered separately from the values, and so the label and help text are accessed differently. The [https://github.com/django/django/blob/a38ae914d89809aed6d79337b74a8b31b6d3849a/django/contrib/admin/helpers.py#L264 code which provides them] never looks at `ModelForm._meta`, but [https://github.com/django/django/blob/a38ae914d89809aed6d79337b74a8b31b6d3849a/django/contrib/admin/helpers.py#L167 code further up in the same file] does.

I'm attaching a crude patch against master which factors out the existing logic and reuses it in both spots I linked. Discovered this issue while trying to meet a deadline for a project so I don't have time to do a proper PR or even run the tests. The patch works for my manual testing, but your mileage may vary. It at least illustrates where the issue is and a possible fix. **Note:** The patch does not keep the behavior in `AdminReadonlyField` where it flips between using `class_name` and `field`. No explanation is given in the code for why it alternates, and it seems illogical to me, but maybe someone knows better. The patch simply uses `class_name`."	Bug	closed	contrib.admin	2.0	Normal	fixed	readonly, help_texts, labels		Accepted	1	0	0	1	0	0
