Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
11093 Lượt xem

When a user or employee creates a leave request and clicks the "Confirm" button ( action_confirm) , an automatic notification email will be gone to the user's email. How to stop this?  I have user management implemented in hr_holidays so have different states and user approvals for a leave request. I have also implemented notification email templates for all the approvals. So now when an employee confirms a leave request two emails are gone to the user mail.

1. Default odoo email notification.

2. My custom created email notification .

Where is the code for this notification mail is called?

Notification email image down below:


Please Help!!!


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Fixed the issue, I created a new "custom_layout" for my email template I created, which solved my issue.Thank you for the help @Niyas Raphy

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello

Try below code to avoid email notification when try to create new record (version 10.0)

For example if you want to create new task but disable email notification to follower you can reference below code

task = super(Task, self.with_context(mail_notrack=True)).create(vals)

Hope this help you.

Best Thanks,

Ankit H Gandhi.


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Pravitha, I'm having the same issue. Did you create a new mail.template and inserted in the def action_confirm(self)?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Pravitha,

You can try to uncheck this approved, so that the mail wont get send.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thankyou Niyas, but it didn't work for me. I am having some problem with my email server. Anyway speaking about your answer, I have to manually do this all the time when I create a leave request?Is there any backend solution. Cos I have already tried commenting out the "self.add_follower(employee_id)" in the "write" function of hr.holidays, but didn't work.

you can try to redefine the states field without track_visibility

Tác giả

Not working !!

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 24
20024
0
thg 10 23
1135
1
thg 9 23
2899
0
thg 6 23
1662
3
thg 5 23
5485