You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Usually tags in crm app are created by regular users (sales managers). In this case, their department is assigned to the tag automatically.
But now you are logged into the site as a superuser.
To be able to access materials from all departments, the superuser may have a state of no assigned department.
Therefore, to create a tag, you first had to select a department (in the right sidebar).
To avoid this situation, we can dynamically add a department select field to this view.
This can be done in get_form method of TagAdmin.
If the current user's department is not specified (request.user.department_id),
then use the widget forms.Select() for the "department" field (form.base_fields['department'].widget)
else forms.HiddenInput().
After making changes, don't forget to run the tests.
The text was updated successfully, but these errors were encountered: