-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] resource_calendar_get_days: pre-commit auto fixes
- Loading branch information
1 parent
6e973aa
commit 26f2526
Showing
6 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from . import resource_calendar | ||
from . import hr_leave_allocation | ||
from . import hr_leave_allocation |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
from odoo import api, fields, models, _ | ||
from odoo import api, models | ||
|
||
|
||
class HolidaysAllocation(models.Model): | ||
_inherit = 'hr.leave.allocation' | ||
_inherit = "hr.leave.allocation" | ||
|
||
@api.depends('number_of_days', 'employee_id') | ||
@api.depends("number_of_days", "employee_id") | ||
def _compute_number_of_hours_display(self): | ||
for allocation in self: | ||
if allocation.number_of_days: | ||
allocation.number_of_hours_display = allocation.number_of_days * allocation.employee_id.sudo().resource_id.calendar_id.hours_per_day | ||
allocation.number_of_hours_display = ( | ||
allocation.number_of_days | ||
* allocation.employee_id.sudo().resource_id.calendar_id.hours_per_day | ||
) | ||
else: | ||
allocation.number_of_hours_display = 0.0 | ||
allocation.number_of_hours_display = 0.0 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |