This question has been flagged
2 Replies
8527 Views

January, the 14th 2020, I have created a month allocation like this:

Allocation Type : Accrual Allocation
Until :

Add 1,00 Day every Month

But at the 1st day of the month (Febuary 1st), this leave allocation is not added to the employees.

Is this leave allocation added at the first day of the month or every month at the created date (in this example 14th day of the month)?

Avatar
Discard
Best Answer

Hello,
Activate Developer mode from general settings.
Go to Settings>Technical>Scheduled Actions.

Check for this scheduled action, this action is responsible for doing this job.

Screenshot from 2020-02-04 11-42-31.png

Here you can see the Next Execution Date, and interval as 'Execute Every'.

[Update]
So when this action runs based on the schedule, it will call the _update_accrual() method.
Screenshot from 2020-02-05 13-04-42.png

First part of that method.
In this method, Odoo takes all the allocations that have nextcall(is a date) set as False or nextcall is less than today along with many other conditions.

When we create a new allocation, nextcall will be False. and odoo will reset nextcall based on the interval(Day/Week/Month) 

So in your case,

You created allocation on 14th Jan, if you created the allocation before 18:00:59, Your allocations nextcall will be on 14th Feb. else Your nextcall will be 15th Feb. 

 You can use 'Run manually' button to run this action manually when ever you wish.

Avatar
Discard
Author Best Answer

hi

thx for the answer, i verified the scheduled actions in developper mode. I think this scheduled action is correctly configured :

Model : Time Off Allocation

Scheduler User  : OdooBot

Execute Every :  1 Days

Active : Yes

Next Execution Date : 04/02/2020 18:00:59

Number of calls : -1

Priority :  5

My problem is : if you configured a monthly allocation time off (1 day/month) :

when this allocation is added to the employee? At the first day of the month or at the created date of the automatic allocation (the 14st day off the month in my example)?

Avatar
Discard

Answer updated. Please check

Author

Thx for the anwser and the explanations. Everything is alright, my allocation will be added at 14st day of the month (creation date).