We need to restrict employees sick leaves for future dates. He will be able to apply only past dates not for future.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Dự án
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
You can do something like this, in the constrains check the leave type and given dates and raise validation error if the entered date is a future date.
class HRLeave(models.Model):
_inherit = 'hr.leave'
@api.constrains('request_date_from', 'request_date_to')
def check_sick_dates(self):
# set current date to the variable current date
if self.holiday_status_id.name == 'Sick Leaves':
if self.request_date_from > current_date or self.request_date_to > current_date:
raise ValidationError(_("Sick Leaves is not allowed for Future Dates.. !"))
Thanks
Hi Mitul Could you please elaborate below answer because I am new to Odoo:
there are many ways to achieve this.
you can achieve this using the override the create method / constraints / onchange of the startdate-enddate and leave type.
Hello
there are many ways to achieve this.
you can achieve this using the override the create method / constraints / onchange of the startdate-enddate and leave type.
Hello Raja,
Its not available out of the box, but you can customize to accommodate the requirements. If you need assistance in doing so contact bd@erpfied.com
Best Regards
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
|
1
thg 5 23
|
3897 | ||
|
|
2
thg 1 23
|
2955 | ||
|
|
1
thg 11 22
|
6361 | ||
|
|
0
thg 10 17
|
4390 | ||
|
|
1
thg 1 17
|
4607 |