-
-
Notifications
You must be signed in to change notification settings - Fork 780
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
[17.0][ADD] project_timesheet_holidays_contract
#1290
base: 17.0
Are you sure you want to change the base?
[17.0][ADD] project_timesheet_holidays_contract
#1290
Conversation
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.
pre-approving, some minor suggestions
project_timesheet_holidays_contract/tests/test_hr_employee_calendar.py
Outdated
Show resolved
Hide resolved
project_timesheet_holidays_contract/tests/test_hr_leave_days_timesheet.py
Outdated
Show resolved
Hide resolved
e6804d5
to
fe6f507
Compare
fe6f507
to
4214bf0
Compare
4214bf0
to
4c78005
Compare
@SilvioC2C PR is updated, thanks for the perfect suggestions. |
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.
Could use some more tests, but overall LGTM
Thanks for your work!
f2bfc8d
to
81c88c6
Compare
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.
Code looks ok but after reviewing it I'm still not sure what this module brings.
Module allows to take into account employee contract along with provided | ||
end date when timesheet on time off. |
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.
IMO you could develop a bit more how this works, because after reading it twice, I'm still not sure what the module does.
# If only one contract, return it regardless of its state | ||
if len(contracts) == 1: | ||
return contracts[0].resource_calendar_id | ||
|
||
# Filter out cancelled contracts if there are multiple contracts | ||
valid_contracts = contracts.filtered(lambda c: c.state != "cancel") |
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.
So in case there's only one contract that is canceled, it still must be used? 🤨
self = self.with_context(date_to=to_datetime) | ||
|
||
result = {} | ||
for employee in self: |
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.
For all these functions, wouldn't grouping employees by calendar improve perf instead of iterating through all the employees?
@@ -0,0 +1,3 @@ | |||
from . import common |
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.
from . import common |
from odoo.tests import common | ||
|
||
|
||
class ProjectTimesheetHolidaysContractCommon(common.TransactionCase): |
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.
class ProjectTimesheetHolidaysContractCommon(common.TransactionCase): | |
class ProjectTimesheetHolidaysContractCommon(common.BaseCase): |
To have all tracking disabled
@@ -0,0 +1 @@ | |||
Module allows to take into account employee contract along with provided end date when timesheet on time off. |
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.
Can you elaborate here a bit?
Module allows to take into account employee contract along with provided end date when timesheet on time off.