This question has been flagged
2 Replies
6810 Views

how to exclude public holidays and weekends of leaves for the employee works and pays per hour 

Avatar
Discard
Best Answer

Hello Fabiola,

Although there exists a "Working schedule" at the `hr_contract` module, that could be used to define the workweek and exclude "weekends" from leaves (the underlying business object is `resource.calendar`), the official `hr_holidays` module doesn't support excluding public holidays or weekends.

You can overcome the lack of "public holidays" by grouping employees by Tag and creating yearly allocations (by Employee Tag) and then registering/approving leave-requests (by Employee Tag as well) for these days. Public holidays are usually common to all employees but that might not be always the case. If employees observe different holidays, you can use different tags to group them before creating allocations. This idea is not new, it has been previously discussed here.

Excluding weekends (week days not part of the workweek) is harder because (1) you would require to repeat the above procedure to exclude each weekend, and, (2) it is more common to have employees with different workweeks in the first place.

Community addons have been developed to fulfill this requirement, I've just found the following one but is for v7.0 and I have never used it (having lot of dependencies increases chances of including broken modules), you may give it a try:

https://apps.openerp.com/apps/7.0/hr_holidays_extension/ 

Just in case, this link contains references about the official `hr_holidays` module (somehow outdated):

https://doc.odoo.com/6.0/book/4/4_11_HR/4_11_HR_holidays/ 

Regards.

Avatar
Discard
Best Answer

It is not possible to do massive leaves request for a group of employees, by employee tag.

This is because, the leave request mode is only available "by employee". There is not drop down box, to change it into "by employee tag" mode.

I did trial in Odoo Online Demo account.

- Tag selected targeted employees, for ex : 10 employees with the word " Employee"

- Leave request allocation for 28 days Public Holidays , allocation mode "Employee Tag", tag name "Employee"

- All 10 employees, got 28 days Public Holidays allocation perfectly, but

- the record shown that allocation mode is converted into " by employee" for each individual, not "by employee tag" like what it supposed to be


My guess, this is the reason, why the massive leaves request does not work, by employee tag. Because the allocation mode, is got converted from "by Employee Tag" to "by Employee".

Which means, the tag is helping only to inject the holidays allocation quota in the beginning.

If anyone knows, how to request holidays/leaves based on tag, please jump in.


Thanks


Avatar
Discard