Saturday 1 August 2015

Example For Server Action

    Hi all,
         Here am explaining how to trigger an automatic email to immediate manager,while an employee submitting  his/her leave request.


Step1.

 

     Configure out going mail server(already explained in my previous post).


step2.

 

   *)Create a Template for mail

 

    name:template_leave_email
    Applies to:Leave
    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 ]].Please see that one.
            Thanking You.
    from:${object.employee_id.work_email}
    To(emails):${object.employee_id.parent_id.work_email}
    Language:${object.partner_id and object.partner_id.lang or ''}
    Outgoing mail server:(localhost)

























   *)Create a server action

 

     Action Name:leave_request_manager
     Base Model:Leave
     Action To Do:Send Email
     Condition:True
     Sequence:5
     Email Template:template_leave_email(select the template we are already created)


step3:Customize the workflow

 

      Setting->Workflows->Workflows->hr.wkf.holidays
      take the confirm button
      and attach our new server action with it.









No comments:

Post a Comment