Hi,
I need to count all days in Leave request.
using v13 community edition.
Please advise any solution or suggest any module
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
I need to count all days in Leave request.
using v13 community edition.
Please advise any solution or suggest any module
Hi,
If you are looking to include the leave days in the time off request, you need to modify the function _get_number_of_days in the model hr.leave .
Inherit the model and rewrite the corresponding function like this, and make sure it will not make error in other existing functionalities.
from odoo.addons.resource.models.resource import float_to_time, HOURS_PER_DAY
class HolidaysRequest(models.Model):
_inherit = "hr.leave"
def _get_number_of_days(self, date_from, date_to, employee_id):
days = (date_to - date_from).days
return {'days': days, 'hours': HOURS_PER_DAY * days}
Thanks
Thank you Niyas Raphy
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Jan 24
|
7690 | ||
|
0
Mar 21
|
975 | ||
ODOO COMMUNITY V13 - BARCODE
Solved
|
|
1
Aug 24
|
13206 | |
|
2
Jan 23
|
4101 | ||
|
0
Jul 22
|
1899 |