Odoo Help

2

OpenERP 7 : Sending email to manager when employee applies a leave

By
Manjunath
on 3/21/13, 10:26 AM 8,809 views

Hi,

I need to send an email to the manager of the employee whenever an employees applies a leave and also need to send an email to the user when manager approves or reject the leave application.

6

Remya

--Remya--
5823
| 7 8 8
Thiruvananthapuram, India
--Remya--

Working as an Senior ODOO developer. http://in.linkedin.com/pub/remya-r/69/a23/298

Remya
On 4/11/13, 8:19 AM

For this you want to create two server action. Setting->Technical->Actions->Server Actions. Create a new server action for leave request to manager Action name:leave_request_manager.

Object:Leave

Action type:Email

Condition:True

Email Address: object.employee_id.parent_id.work_email

Subject: Leave Request from [[ object.employee_id.name ]]

Message: Dear [[object.employee_id.parent_id.name]],

You have one Leave Request from [[ object.employee_id.name ]]. Kindly click the link below to validate the application form. Web: localhost:8069 or ipaddress:8069

Thank you.

Create a new server action for approve mail from manager.

Action name:leave_approval_manager.

Object:Leave

Action type:Email

Condition:True

Email Address: object.employee_id.work_email

Subject: Leave Approval of [[object.employee_id.name]]

Message: Dear [[object.employee_id.name]]

[[object.number_of_days_temp]] day(s) leave from '[[object.date_from]]' to '[[object.date_to]]' has been approved.

Thank You.

Action name:leave_refusal_manager.

Object:Leave

Action type:Email

Condition:True

Email Address: object.employee_id.work_email

Subject: Leave Refusal of [[object.employee_id.name]]

Message: Dear [[object.employee_id.name]]

[[object.number_of_days_temp]] day(s) leave from '[[object.date_from]]' to '[[object.date_to]]' has been refused.

Thank You.

Next step is you want to call these server actions from workflow.

Setting->Technical->Workflow->Workflow->hr.wkf.holidays

confirm->server action->leave_request_manager

validate->server action->leave_approval_manager

refuse->server action->leave_refusal_manager(Kind:Dummy in Workflow)

Thus you can configure it

Thanks, it works and was very usefull to me

Sebastián Fiorentini
on 6/3/13, 10:15 AM

This is really useful! Especially on how to embed the fields from the data!

dave ellis
on 6/4/13, 7:47 AM

This really helped me a lot, but I have a question - posted here --> http://help.openerp.com/question/42224/how-to-set-more-than-one-email-in-server-action/

Vitap ramdevputra
on 1/22/14, 8:07 AM
0
CodeCrax
On 3/22/17, 9:07 AM

Even I have the same problem of sending email notifications of leave management. Kindly, please do assist me with the same in Odoo 10 because what's above is completely different from the ones that Odoo 10 is having right now. Thanks in Advance!

0
ABC
On 6/27/13, 10:13 AM

I ma unable to send mail... :( Can u help me plzzzz.....

i am getting error as

Mail delivery failed

Mail delivery failed via SMTP server 'smtpout.asia.secureserver.net'. SMTPSenderRefused: 550 <name@name> size=540 invalid address name@name

please specify your overall configuration

Remya
on 6/28/13, 2:06 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)

Stats

Asked: 3/21/13, 10:26 AM
Seen: 8809 times
Last updated: 3/22/17, 9:07 AM