Skip to content

Conversation

@arpi-odoo
Copy link

No description provided.

@robodoo
Copy link

robodoo commented Dec 24, 2025

This PR targets the un-managed branch odoo-dev/odoo:master-hr-onboarding, it needs to be retargeted before it can be merged.

@ramezlahzy ramezlahzy force-pushed the master-hr-onboarding-raibr branch from 0fe8a98 to 082016e Compare December 29, 2025 16:11
Steps to reproduce:
- Open an employee form view
- Go to the payroll section
- Observe an unused "New Contract" button

Bug cause:
The "New Contract" button was present in the employee form view's payroll section
but had no functionality or was redundant with existing contract creation methods.

Solution:
Make the button 'New Contract' invisible if there is no contract start date.

task-5447186
… parameter

**Steps to reproduce:**
1. Navigate to Time Off >> Configuration >> Time Off Types
2. Open any leave type
3. Click on Smart button "Time Off"
4. Click on "New" to create a new allocation
5. Try to search leave types by virtual_remaining_leaves with comparison operators
6. Run test suite: test_search_virtual_remaining_leaves.py

**Bug cause:**
The `_search_virtual_remaining_leaves` method was missing the `value` parameter
when calling the comparison operator function `op()`. The method was:
  - Retrieving the correct operator from PY_OPERATORS dict
  - Converting the search value to float
  But then failed to pass this `value` to the operator when executing the comparison:
  `op(leave_type.virtual_remaining_leaves)` instead of
  `op(leave_type.virtual_remaining_leaves, value)`

This caused the search to fail silently or return incorrect results when
filtering leave types by virtual remaining leaves.

**Solution:**
Added the missing `value` parameter to the operator call:
  `return not leave_type.requires_allocation or op(leave_type.virtual_remaining_leaves, value)`

This ensures the comparison operator has both operands (the leave type's
virtual_remaining_leaves and the search value) needed to perform the comparison.

**Tests status:** All 13 tests in test_search_virtual_remaining_leaves.py now passing ✓

Task Id: 5447343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants