-
-
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
[MIG] 11.0 Backport of hr_attendance_report_theoretical_time #559
Conversation
Theoretical vs Attended Time Analysis ===================================== This module adds a new report called "Theoretical vs Attended Time Analysis" that compares worked time, measured through attendances records, with the theoretical time, computed from employee's working calendar, public holidays and employee specific leaves. There is the possibility of counting as theoretical time some leave types if specified in them. Installation ============ On installation time, this module computes the theoretical hours for the day of the attendance check-in, so if you have a lot of records, this would be a bit slow. Configuration ============= You need to be at least "Attendance / Manual Attendance" for being able to see the attendances report. For including some leave types in the theoretical time, you have to: * Go to Leaves > Configuration. * Select leave type you want to include. * Check the mark "Include in theoretical hours". Usage ===== * Go to *Attendances > Reports > Theoretical vs Attended Time Analysis*. * Check pivot table or look at the graph view. Known issues / Roadmap ====================== * Employees with less than 1 week in the company will show full week theoretical hours. * Activate ORM cache for improving performance on computing theoretical hours, but assuring that the cache is cleared when the conditions of the computation changes. * If you change employee's working time, theoretical hours for non attended days will be computed according this new calendar. You have to define start and end dates inside the calendar for avoiding this side effect. * Recompute theoretical hours of affected days when changing the leave type to be included or not in theoretical time.
Currently translated at 100.0% (26 of 26 strings) Translation: hr-10.0/hr-10.0-hr_attendance_report_theoretical_time Translate-URL: https://translation.odoo-community.org/projects/hr-10-0/hr-10-0-hr_attendance_report_theoretical_time/de/
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
* Standard procedure * Adapt data model * Adapt views * Adapt code for date handling * Adapt tests
hr_attendance_report_theoretical_time/models/resource_calendar_leaves.py
Outdated
Show resolved
Hide resolved
hr_attendance_report_theoretical_time/reports/hr_attendance_theoretical_time_report.py
Outdated
Show resolved
Hide resolved
@@ -6,6 +6,9 @@ class ResourceCalendarLeaves(models.Model): | |||
|
|||
@api.model | |||
def search(self, args, offset=0, limit=None, order=None, count=False): | |||
""" | |||
This function is overrided in order to add the domain into searches |
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.
A docstring should explain for what is used the code, no what code does, which is self-explanatory. Try with something like:
Inject extra domain when being called from _theoretical_hours method.
WARNING: This method should be called only once with that context
from a restricted piece of code, or can have side effects.
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 employees with manual attendance can't see their own report from a menu, but they can access to the view and see all employee attendances.
Would be nice that every employee could access to this menu an see only their own report.
@@ -0,0 +1,28 @@ | |||
You need to be at least "Attendance / Manual Attendance" for being able to see |
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.
At least you have to be Officer because parent menu requires it.
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.
This wasn't this way in v10, but on v12 this menu was accessible by all, so you should turn to the changes I was doing in v10 for this. There's a record rule for making that users with manual attendance only see their attendances any way.
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.
Still being an inconsistency between readme and module functionality at least in v11.
If you want to keep as this way please change readme
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.
Did you attend this comment?
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.
Sorry, i forgot, just changed it in #576
3b8e107
to
b97aa35
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.
👍 Technical and functional review.
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 and functional review on runbot. LGTM 👍
<filter name="current_month" string="Current Month" domain="[('date', '>=', datetime.date.today().strftime('%Y-%m-01'))]" /> | ||
<filter name="current_year" string="Current Year" domain="[('date', '>=', datetime.date.today().strftime('%Y-01-01'))]" /> | ||
<separator/> | ||
<filter name="my" string="My Attendances" domain="[('employee_id.user_id.id', '=', uid)]" /> |
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 name="my_attendances"
Is this still WIP? |
@yajo I think here access for |
I don't understand what you said, sorry. The PR title starts with WIP, that's why I asked. Is it WIP then? |
Backport of
hr_attendance_report_theoretical_time
to 11.0.Due to big changes in Odoo 12 regarding hr modules, i have needed to do a hook with resource.calendar.leaves in order to make the domain work properly. I don't know if this is the proper solution...
@jbeficent