Odoo Aide

4 Answers
25/02/2019 02:44

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. 



Cybrosys Techno Solutions Pvt.Ltd

--Cybrosys Techno Solutions Pvt.Ltd--
Cybrosys Technologies
| 6 5 8
Calicut, Inde
--Cybrosys Techno Solutions Pvt.Ltd--

Cybrosys Technologies is a private limited ISO certified company in Technology and Software Engineering sector. We serve as one of the best and trusted Odoo official partner, providing ultimate Customization and Implementation services in Odoo ERP. A frequent contributor to Odoo Apps, our customized free apps are downloaded by more than one lakh users. Most of our apps augment the potentialities of Odoo and are trending in the Odoo app store.

Cybrosys keeps privilege to be one among the finest Odoo Official Partners with 200+ free apps contribution towards the Odoo community. Cybrosys also stands number one in Odoo-social Media Integration empowering every kind of business solutions.

We are also enriched with highly skilled UI/UX technical experts for Developing, Implementing and Designing, thereby providing ultimate benefit to our customer base.

Today Cybrosys has reached par excellent in Odoo Implementation and allied services, proving its credibility and reliability. Our proven services are used by customers sprawling across 160+ countries including Middle East, African continents, UK, Germany, Spain, Thailand, Hong Kong, New Zealand, Australia, Malaysia, Singapore, Egypt etc.

We are rapidly expanding our base with robust quality management and business process re-engineering to meet the ultimate customer desire.

To know more about Cybrosys Technologies and our Odoo Apps, Kindly visit:

Cybrosys Technologies 

Odoo Apps 

And inbox us your queries to odoo@cybrosys.com

Cybrosys Techno Solutions Pvt.Ltd
22/02/2019 22:56


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.. !"))


22/02/2019 14:14

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 


Mitul Shingala

--Mitul Shingala--

| 5 3 7
Rajkot, Inde
--Mitul Shingala--

Odoo Developer

Mitul Shingala
22/02/2019 08:59


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. 


Poser une question
Keep Informed
1 Abonné(e)s
About This Community

This platform 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.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now