Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

leaves unit of measure

Subscribe

Get notified when there's activity on this post

This question has been flagged
hrv7leaves
1 Reply
7157 Views
Avatar
Davide Corio

it seems that leaves can be requested in days only. if, using date from/to fields on the leave request form, i select 4 hours, openerp counts always 1 day.

is it possible to change this behaviour? are you aware of 3rd party addons that modify this and allow to specify hours instead of days?

2
Avatar
Discard
Avatar
Cyril Gaspard (GEM)
Best Answer

Hi,

perhaps :

menu settings/configuration/sales check box to True for "Allow using different units of measures" and apply

now, in menu sales/configuration you will have a new section "units of measure".

click on this section and you will have days and hours as "working time category".

days is the unit of reference, and hours lower than the unit of reference (warning, just configure one unit of reference by category, there was a bug with this in 6.0, but now ???)

then to compare unit of reference and other (smaller or biggert than unit of reference), use ratio value.

Update :

I'm looking hr holidays code, the problem comes from 2 functions onchange_date_from and onchange_date_to.

In the first if you add value only in date_from, value returned is 8 hours, with working time unit of measure this will correspond to one day (see the ratio days/hours).

if there is date_from and date_to, this will return :

diff_day = self._get_number_of_days(date_from, date_to)
        result['value']['number_of_days_temp'] = round(math.floor(diff_day))+1

here round will convert float to integer with 0 as result for 4 hours, that's why it is add + 1 after round function. This is strange because number_of days has type float ...

I think this is an error ....

Update 2 :

solution here could be, but to test result (not done), by adding 2 decimals to the result :

result['value']['number_of_days_temp'] = round(math.floor(diff_day), 2)

perhaps verify the rest of the code too and just add filter cases for 1/4 day, 1/2 day, 3/4 day.

Hoping that solves your problem.

Bye

1
Avatar
Discard
Davide Corio
Author

unfortunately that setting isn't used by the hr application.

Cyril Gaspard (GEM)

Hi, I update my answer. This will explain why you already have 1 day for 4 enter's hours. Bye

Davide Corio
Author

i actually think the reason is that in belgium it isn't possible to ask leaves in hours, then they round them to 1 day

Cyril Gaspard (GEM)

I proposed a solution for the 2 functions, but I not verify the rest of the code. Bye

Cyril Gaspard (GEM)

"i actually think the reason is that in belgium it isn't possible to ask leaves in hours, then they round them to 1 day",, I believe this is an international erp. Bye.

Cyril Gaspard (GEM)

perhaps to report as a bug ?

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
How can I import photos of my employees into HR module? Solved
hr v7
Avatar
Avatar
Avatar
Avatar
3
Oct 23
14316
How do I send out emails to all followers when an update happens in the HR (hiring) module)
hr v7
Avatar
Avatar
1
Mar 15
8284
There is no reference available for base.element
hr v7
Avatar
0
Mar 15
5113
How to allow manager to access his employees or his department only? Solved
security hr v7
Avatar
Avatar
Avatar
Avatar
14
Sep 24
25961
How to carry forward leaves from year to next year or month to next month?
hr leaves customization
Avatar
Avatar
1
Jan 18
6825
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now