remove the help text about billing entity being read only
The issue is that when obj.has_inherited_billing_entity is True, the code adds "billing_entity" to the readonly fields. When a field is marked as readonly, Django may exclude it from form.base_fields, which causes a KeyError when trying to access it.
This commit is contained in:
parent
8ba9787d4b
commit
014e88aa24
1 changed files with 0 additions and 10 deletions
|
|
@ -73,16 +73,6 @@ class OrganizationAdmin(admin.ModelAdmin):
|
|||
|
||||
return readonly_fields
|
||||
|
||||
def get_form(self, request, obj=None, **kwargs):
|
||||
form = super().get_form(request, obj, **kwargs)
|
||||
|
||||
if obj and obj.has_inherited_billing_entity:
|
||||
form.base_fields["billing_entity"].help_text = _(
|
||||
"This billing entity is inherited from the organization's origin and cannot be modified."
|
||||
)
|
||||
|
||||
return form
|
||||
|
||||
|
||||
@admin.register(BillingEntity)
|
||||
class BillingEntityAdmin(admin.ModelAdmin):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue