[Bug]: Filtering Activity Plans by "Department" in Sales crashes with a server error
Description
On the Sales → Configurations → Activity Plans page, the filter options include a "Department" field. Selecting it doesn't work — it breaks the page with a server error instead of letting you filter. The same "Department" field also appears (and fails) on an Activity Plan's details page.
Steps to Reproduce:
- Log in as an admin.
- Go to Sales → Configurations → Activity Plans.
- Click the filter icon (top right) → "Add rule".
- From the list of fields, select "Department".
(You can also reproduce it by opening any existing Activity Plan and viewing its details page, since the same "Department" field is shown there too.)
Actual Behaviour:
The page shows an "Internal Server Error" — a LogicException saying the relationship "department" does not exist on the Activity Plan model. The whole screen breaks and you can't continue using the filter.
Expected Behaviour:
Selecting "Department" should either work correctly and show a proper department dropdown to filter by, or the "Department" option should not appear at all in the Sales Activity Plans screen, since departments are an HR/Employees concept and don't really apply to Sales. Either way, it should not throw a server error.
Screenshot:
https://github.com/user-attachments/assets/7457ea0a-775b-4171-80f1-ac023c280cdb
Source: aureuserp/aureuserp