Odoo Help

Welcome!

This community 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.

2

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

By
Manjunath
on 3/21/13, 10:26 AM 8,342 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--
5813
| 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
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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 3/21/13, 10:26 AM
Seen: 8342 times
Last updated: 5/18/16, 5:42 AM