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.

0

Automate Leave Allocations

By
Simon Ondimu
on 7/5/16, 10:16 PM 509 views

I am using Odoo v8 and my client wants to have the accrual function on leave management. Unfortunately the current apps for that haven't been ported to v8 or v9

                   https://github.com/OCA/hr/tree/7.0 and

                   https://github.com/OCA/hr/issues/224

Is there a way i can script an automated action that creates an Allocation Request , then links the allocation request to a particular Leave Type and Employee Tags and adds a particular number of days eg 1.75? This should be run every month and if possible make it approved.

Any help will be appreciated.


1
Asmita Chavan
On 7/8/16, 8:24 AM

You can write script in Automated action, which will find the start_date in Employee's contract (which we will assume as joining date of the employee) and will compare the date on which scheduler is running,

And accordingly we will compute the number of days to be allocated to employee, if leaves has to be assigned on pro-rata basis, or else we will allocate overall leaves which are configured in leaves master.

The Solution you are thinking of is absolutely possible..

Could you help me with the script or the process? i am still new to Odoo programming.

Simon Ondimu
on 7/8/16, 2:16 PM

<record model="ir.cron" id="account_asset_cron">

<field name="name">Generate Asset Entries</field>

<field name="interval_number">1</field>

<field name="interval_type">months</field>

<field name="numbercall">-1</field>

<field name="doall" eval="False"/>

<field name="model" eval="'account.asset.asset'"/>

<field name="function" eval="'_cron_generate_entries'"/>

<field name="args" eval="'()'" />

</record>

You can refer to this cron job, where you can set the interval in days, months, years.

In model you should use model, for which you want to create the automated action.

In function tag you should use the method, which should get triggered in this cron job.

If you are using version uptil 8, you can test the cron job by setting the next scheduled datetime from front-end.

If you are using v9, you have button on cron job record to trigger the action.

Asmita Chavan
on 8/11/16, 8:23 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

1 follower(s)

Stats

Asked: 7/5/16, 10:16 PM
Seen: 509 times
Last updated: 7/8/16, 8:24 AM