Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1028 Zobrazení

Hello,  is there a way to set it so a manager is notified when someone cancels PTO that has been approved already?

Avatar
Zrušit
Nejlepší odpověď

Hello James Hinton,

I hope you are doing well.

Here, you can find an example of automated action to notify the person responsible / manager for the employee cancels Paid Time Off Leave.

Find Example in the comment.

I hope this can help you.

Thanks & Regards,
Email:   odoo@aktivsoftware.com 

Skype: kalpeshmaheshwari

Avatar
Zrušit

For Example -
Note - Check Indentation of the code after pasting the code.
Change the f String as per your requirement.

- Create an automated action by adding
name, model( Time Off (hr.leave) as per your requirement),
trigger(update as per your requirement), Trigger fields (Active (hr.leave), Before Update Domain( Active is set ), Apply on ( Active is not set ) as per your requirement), Action To Do ( Execute Python Code ).

- In the Python Code Below Paste this code:-

for leave in records:
if leave.holiday_status_id.name == 'Paid Time Off' and leave.employee_id.parent_id:
leave.employee_id.parent_id.message_post(message_type="notification", body=f"Notification: {leave.employee_id.name} has canceled the PTO Leave")