Odoo Aide

0
4 Answers
0
Raja
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. 

 

0
Avatar

Cybrosys Techno Solutions Pvt.Ltd

--Cybrosys Techno Solutions Pvt.Ltd--
Cybrosys Technologies
https://www.cybrosys.com
7702
| 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

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

0
BD
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 

0
Avatar

Mitul Shingala

--Mitul Shingala--

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

Odoo Developer

Mitul Shingala
22/02/2019 08:59

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. 

 

Poser une question
Writer
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.

Register
Odoo Training Center

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

Test it now