-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
[12.0][MIG] hr_calendar_rest_time #709
Conversation
- hr_calendar_rest_time: Adds rest time to the calendar attendance records - resource_hook: Extends the resource with hooks to standard methods
ac054b6
to
5453b1e
Compare
@etobella @alexey-pelykh @JordiBForgeFlow @Saran440 Could you review please? Thank you! |
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.
@jarroyomorales Sorry for delay, In core odoo, you can create day period morning and afternoon in working times.
I think result is not difference.
Average hour per day
should be 8.00 hours. excludeRest Time
Day Period
should be addAll Day
and code reviewed
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* Define rest time in the resource calendar to adjust the number of worked | ||
hours during the day taking this time into consideration. |
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.
please, add history version 12.0.1.0.0
* Introduce hook in method '_get_work_days_data' of ResourceMixing class in | ||
order to allow changes in the logic to compute working hours within an | ||
interval. A new method '_get_work_hours' is now provided for this purpose. | ||
The method can be inherit to alter the standard behaviour. |
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.
please, add history version 12.0.1.0.0
@Saran440 Thanks for the review. Yes, the total hours per day will be the same |
Okay, I see. |
@Saran440 Well, it is the version and the date when it was done, why would I change it to 12.0 and today's date? |
@jarroyomorales Sorry, I mean add history v.12 in newline but not sure that necessary. |
@Saran440 Oh sorry, I misunderstood you. There haven't been major changes so I think we can keep it like this. |
@jarroyomorales Okay. by the way, I'm not sure that you see this sentence. |
5453b1e
to
31e9c04
Compare
31e9c04
to
c060476
Compare
@Saran440 Comments attended! Added a new |
def _onchange_hours_per_day(self): | ||
if self.env.context.get('use_old_onchange_hours_per_day'): | ||
return super()._onchange_hours_per_day() | ||
attendances = self.attendance_ids.filtered( |
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.
Why are you filtered attendance_ids not date_from
and date_to
?
I tested create Starting Date
and End Date
.
It not used Rest Time
to calculate Average hour per day
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.
Yes, I know this is an issue but it is the same way odoo does it in the core resource
module.
At first I implemented the right solution taking into account the start and end date but it is not that easy. You would need a cron to check every day which lines are active are need to be used for the calculation and then update the value, since it is computed in an onchange.
Maybe we can add this behavior but it should probably be in another module.
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.
Functional Test. LGTM 👍
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.
LGTM 👍
@OCA/human-resources-maintainers Can this be merged? |
/ocabot merge |
On my way to merge this fine PR! |
It looks like something changed on |
Congratulations, your PR was merged at 0b4e741. Thanks a lot for contributing to OCA. ❤️ |
Migration to 12.0 of
hr_calendar_rest_time
and it's hook moduleresource_hook