- 
                Notifications
    You must be signed in to change notification settings 
- Fork 30.2k
[FIX] project_timesheet_holidays: skip validation for flexible hours #224769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
            SaraBriki
  wants to merge
  1
  commit into
  odoo:master
from
odoo-dev:master-fix_traceback_on_validate_leave_for_fully_flexible_employee-brsa
  
      
      
   
      
    
                
     Closed
            
            [FIX] project_timesheet_holidays: skip validation for flexible hours #224769
                    SaraBriki
  wants to merge
  1
  commit into
  odoo:master
from
odoo-dev:master-fix_traceback_on_validate_leave_for_fully_flexible_employee-brsa
  
      
      
   
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
              
                    Einar-eian
  
              
              approved these changes
              
                  
                    Sep 8, 2025 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work, LGTM 🚀
f46d40b    to
    a8d4bd9      
    Compare
  
    Reproduce: - Go to Time Off > Management > Time Off - Create a Time Off for an employee with empty "Working Hours" (Payroll tab on profile). - Ensure the Time Off Type has "Requires allocation" unchecked so it appears in the dropdown. - Save and then try to Validate. Issue: During validation, `_validate_leave_request` assumes the employee has a working calendar and tries to access `calendar.tz`. When "Working Hours" is empty, `resource_calendar_id` is False, leading to the traceback. Fix: Skip timesheet generation and upper bound check when the employee has no working calendar (fully flexible case). A placeholder "Flexible" was also added to the `hr.employee` form view on the field "Working Hours" when empty. task-5048761
a8d4bd9    to
    f8bc29b      
    Compare
  
    
              
                    xavierbol
  
              
              reviewed
              
                  
                    Oct 7, 2025 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work, I left one comment. 🙂
| @robodoo r+ | 
    
  robodoo 
      pushed a commit
      that referenced
      this pull request
    
      Oct 30, 2025 
    
    
      
  
    
      
    
  
Reproduce: - Go to Time Off > Management > Time Off - Create a Time Off for an employee with empty "Working Hours" (Payroll tab on profile). - Ensure the Time Off Type has "Requires allocation" unchecked so it appears in the dropdown. - Save and then try to Validate. Issue: During validation, `_validate_leave_request` assumes the employee has a working calendar and tries to access `calendar.tz`. When "Working Hours" is empty, `resource_calendar_id` is False, leading to the traceback. Fix: Skip timesheet generation and upper bound check when the employee has no working calendar (fully flexible case). A placeholder "Flexible" was also added to the `hr.employee` form view on the field "Working Hours" when empty. task-5048761 closes #224769 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
    
  robodoo 
      pushed a commit
      that referenced
      this pull request
    
      Oct 30, 2025 
    
    
      
  
    
      
    
  
Reproduce: - Go to Time Off > Management > Time Off - Create a Time Off for an employee with empty "Working Hours" (Payroll tab on profile). - Ensure the Time Off Type has "Requires allocation" unchecked so it appears in the dropdown. - Save and then try to Validate. Issue: During validation, `_validate_leave_request` assumes the employee has a working calendar and tries to access `calendar.tz`. When "Working Hours" is empty, `resource_calendar_id` is False, leading to the traceback. Fix: Skip timesheet generation and upper bound check when the employee has no working calendar (fully flexible case). A placeholder "Flexible" was also added to the `hr.employee` form view on the field "Working Hours" when empty. task-5048761 closes #224769 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
    
  robodoo 
      pushed a commit
      that referenced
      this pull request
    
      Oct 30, 2025 
    
    
      
  
    
      
    
  
Reproduce: - Go to Time Off > Management > Time Off - Create a Time Off for an employee with empty "Working Hours" (Payroll tab on profile). - Ensure the Time Off Type has "Requires allocation" unchecked so it appears in the dropdown. - Save and then try to Validate. Issue: During validation, `_validate_leave_request` assumes the employee has a working calendar and tries to access `calendar.tz`. When "Working Hours" is empty, `resource_calendar_id` is False, leading to the traceback. Fix: Skip timesheet generation and upper bound check when the employee has no working calendar (fully flexible case). A placeholder "Flexible" was also added to the `hr.employee` form view on the field "Working Hours" when empty. task-5048761 closes #224769 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Steps to Reproduce
Issue
During validation,
_validate_leave_requestassumes the employee has a working calendar and tries to accesscalendar.tz. When "Working Hours" is empty,resource_calendar_idis False, leading to the traceback.Fix
Skip timesheet generation and upper bound check when the employee has no working calendar (fully flexible case).
task-5048761