Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Reference "department" in request model #144

Open
MoD01 opened this issue Jan 26, 2025 · 1 comment
Open

Incorrect Reference "department" in request model #144

MoD01 opened this issue Jan 26, 2025 · 1 comment
Labels
wontfix This will not be worked on

Comments

@MoD01
Copy link

MoD01 commented Jan 26, 2025

There is something odd with the "department" field in the Requests model.

information about test parameter:

  • role= django superadmin
  • database = MSSQL (I know it is not compatible with MSSQL officially but I am working on it)

How to reproduce the bug:

Image - this leads me to /en/456-admin/auth/group/add/?_to_field=id&_popup=1

? is it correct that the "department" i a "group"?

  • fill the fields with examplary data like that and save:
Image

This results in this:

Image
  • click save at the request web form. This results in an error message and an empty value of the department field.
Image

FYI:
the department field is not part of the requests model but the inherited model Base1. There department is defined like this:

department = models.ForeignKey(
    'auth.Group',
    blank=True,
    null=True,
    on_delete=models.CASCADE,
    verbose_name=_("Department"),
    related_name="%(app_label)s_%(class)s_department_related",
)

is it even required to have department as an mandatory field in request model (in Base1 it is marked as null=True)?

PS: maybe it is an MSSQL problem? MSSQL is not capable of doing database-side regular expressions. I already transferred one on python side to make it compatible. Maybe department also uses regular expressions to filter?

PPS: I think it is a permission problem. I had a superuser with blank groups and permissions. Now I added every permission to my user and now I see something in the departments dropdown.

@DjangoCRM
Copy link
Owner

No. Group is a parent model for the Department. Department should be added as Department, not a Group.
Please read here how to add Departments.
And one more thing. You are trying to add Request using admin site and being in superuser role. To do this, you must first select the department for which you want to add a Request.
It is better to use CRM site for this being in sales manager or operator role. Then everything will be easier.

@DjangoCRM DjangoCRM added the wontfix This will not be worked on label Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants