Good day everyone! I can’t figure out how to implement it. I have created a Custom DocType Task_new. Using ServerScript I show users only those Task_new where it is designated. But it is necessary that in the calendar each user can see all Task_new of all users, but at the same time in other Lists they should see only where it is listed. How to solve such a thing.
Here’s the ServerScript:
user = frappe.session.user
if user == "Administrator":
pass
else:
# SQL-условие для отображения задач, где текущий пользователь указан в любом из перечисленных полей
conditions = f"""(
`tabTask_new`.name in (
select `tabTask_new`.name
from `tabTask_new`
where
`tabTask_new`.name_isp = '{user}'
or `tabTask_new`.otv = '{user}'
or `tabTask_new`.name_utv = '{user}'
or `tabTask_new`.name_ruk = '{user}'
or `tabTask_new`.name_admin = '{user}'
or `tabTask_new`.name_nadl = '{user}'
or `tabTask_new`.name_nadl_2 = '{user}'
)
)"""