arrobalytics / django-ledger

Django Ledger is a double entry accounting system built on the Django Web Framework.
https://www.djangoledger.com
GNU General Public License v3.0
917 stars 215 forks source link

KeyError at /admin/django_ledger/entitymodel/<UUID>/change/ #173

Closed 3leches closed 8 months ago

3leches commented 9 months ago

Describe the bug

Unable to add or modify Entities in the Django Admin. Attempting to create or modify an entry results in the error:

KeyError at /admin/django_ledger/entitymodel/add/
"Key 'slug' not found in 'EntityModelForm'. Choices are: accrual_method, address_1, address_2, admin, city, country, default_coa, depth, email, fy_start_month, hidden, last_closing_date, meta, name, numchild, path, phone, picture, state, website, zip_code."
Request Method: GET
Request URL:    http://127.0.0.1:8000/admin/django_ledger/entitymodel/add/
Django Version: 4.2.6
Exception Type: KeyError
Exception Value:    
"Key 'slug' not found in 'EntityModelForm'. Choices are: accrual_method, address_1, address_2, admin, city, country, default_coa, depth, email, fy_start_month, hidden, last_closing_date, meta, name, numchild, path, phone, picture, state, website, zip_code."

To Reproduce Steps to reproduce the behavior:

  1. Run the dev server
  2. Login to the Django admin in a browser
  3. Click on Add next to Entities
  4. See error

Expected behavior A form to manage entities

Screenshots

image

Desktop (please complete the following information):

Additional context

Commenting out line 38 here will allow the form to load, but I have not been able to figure out how to expose the slug field in the form. I see that it is being added via abstract model mixin, but I'm unable to figure out how to make it available to EntityModelForm.

Thank you!

elarroba commented 9 months ago

174

Thank you. Entities are meant to be created through the /entity/create/ endpoint. I will look at this.

elarroba commented 9 months ago

I am reworking the Admin app to make sure basic functionality exist to create and manage entities. Functionality will be limited in the following version v0.5.5.5 but will continue to add features in future version.