1c391c3dfbdf733304fc882b9045d25e20e6dd1f
On a hr.leave creation on the form view, the fields request_date_from and request_date_to are set on today. The fields date_from and date_to are set on now. We have 2 onchange methods: - _onchange_request_parameters: Set date_from and date_to according to the leave configuration. - _onchange_leave_dates: Set number_of_days according to date_from and date_to As _onchange_leave_dates is called before _onchange_request_parameters, the field number_of_day is always set to 0, even if the leave is taken for all the day (the default value). It means that if you don't modify the dates, the value stored in the database is incorrect. We have to call manually the method _onchange_leave_dates at the end of the method _onchange_request_parameters execution to ensure the validity of the value.
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
Then follow the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%