How to add custom field in assing to (todo)

I want to add a custom field named dept a linking field in this show assign to window how to do that…

Hi:

Needed some customization …

This assignment form is built here:

You could override assign_to.js and assign_to.py files.

Anyway, where this “dept” field come from? Is the user department? Maybe you can automate it on todo creating with a server script.

yeah its the user department & thanks for the help!!

Hi @Keerthanan_Ps:

Ok, I assume we are talking about Employee department (user have not department, so we need to link user and employee) and you have added your “dept” field to “ToDo” doctype, right?

Create a server script, for ToDo doctype, Event: before_insert

employee_department = frappe.db.get_value("Employee", {"user_id": doc.allocated_to}, "department")
doc.dept = employee_department

This way, at assignment, ToDo department “inherits” from Employee …
Hope this helps.