Skip to content
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][ADD] hr_utilization_report: generate Utilization Report from Task Logs #165

Merged
merged 1 commit into from Feb 15, 2019

Conversation

alexey-pelykh
Copy link
Contributor

@alexey-pelykh alexey-pelykh commented Dec 25, 2018

This module allows to generate Utilization Report from Task Logs.

To create report using Utilization Report Wizard:
#. Go to Timesheets > Reporting > Utilization Report Wizard.
#. Configure the data set and click "View".

With project_timesheet_holidays module installed, leaves are not taken into
account: for a single 4-hour entry on specific day with 8 working hours and
4 hours of leaves, capacity would be calculated as 8 hours and utilization
would be calculated as 100%.

Without project_timesheet_holidays module installed, leaves are taken into
account: for a single 4-hour entry on specific day with 8 working hours and
4 hours of leaves, capacity would be calculated as 4 hours and utilization
would be calculated as 100%.

image
image

@alexey-pelykh
Copy link
Contributor Author

@aheficent @lreficent this report may be interesting for you as well

@alexey-pelykh alexey-pelykh force-pushed the 12.0-add-hr_utilization_report branch 29 times, most recently from aa6f091 to a821646 Compare December 26, 2018 15:49
@alexey-pelykh alexey-pelykh force-pushed the 12.0-add-hr_utilization_report branch 2 times, most recently from 47bb4fd to 21a29e4 Compare February 2, 2019 15:02
@alexey-pelykh
Copy link
Contributor Author

@pedrobaeza improved this one to include A/B reporting by not only boolean fields, but also one2many, many2one, and many2many.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the sensation that you are reinventing the BI pivot + XLS export in this module, but with such huge amount of code, it's difficult to review without dedicating hours to this.

hr_utilization_report/models/hr_department.py Outdated Show resolved Hide resolved
hr_utilization_report/models/hr_employee.py Outdated Show resolved Hide resolved
@alexey-pelykh
Copy link
Contributor Author

@pedrobaeza regarding BI pivot + XML export reinvention: definitely no, I've tried that before doing this module, and in comparison to BI pivot this module:

  • works out of the box
  • has a bit of business logic that would be hardly achievable with BI pivot.

In other words, BI pivot is a great tool for making simple 50-liner reports, which this module is not.

@alexey-pelykh
Copy link
Contributor Author

@tarteo would you be interested in reviewing this module?

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

image

I don't understand what is happening here. The subtotal of capacity is 240 but it is e.g. in the first 'group' 0.

@alexey-pelykh
Copy link
Contributor Author

alexey-pelykh commented Feb 13, 2019

@tarteo great catch, fixed both only one, working on other.

@alexey-pelykh
Copy link
Contributor Author

alexey-pelykh commented Feb 13, 2019

@tarteo fixed, please re-review
image

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexey-pelykh Maybe it's nice to make utilization hours red if it's smaller than capacity. If you can't work on it anymore it's OK it just would be nice to have. 😄

@alexey-pelykh
Copy link
Contributor Author

alexey-pelykh commented Feb 14, 2019

@tarteo if you have a suggestion which style to use (that is supported by most themes) - I'll add that :) Like o_subtotal

@tarteo
Copy link
Member

tarteo commented Feb 14, 2019

@alexey-pelykh text-danger?

Copy link
Member

@tarteo tarteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to approve.

@alexey-pelykh
Copy link
Contributor Author

@tarteo one question regarding this coloring: making strict less is 100% bad, there has to be some tiers, like up to 5% is ok, up to 20% is warning, above - fatal.
@aheficent maybe you'll provide feedback as well

@tarteo
Copy link
Member

tarteo commented Feb 14, 2019

@alexey-pelykh Sounds good, but then it must be a setting somehow because it can be different for every company.

@alexey-pelykh
Copy link
Contributor Author

@tarteo In report wizard? In....where?

@tarteo
Copy link
Member

tarteo commented Feb 14, 2019

Would be nice if there are default values per company and in the wizard you can change it to what you want. e.g. when the default threshold for ok is 5% the default threshold in the wizard is 5% but it can be changed in the wizard.
I think the colors can be static like red, orange, and green (text-danger, text-warning, text-success), otherwise it will get crazy 😛

@alexey-pelykh
Copy link
Contributor Author

I'll add that to roadmap :)

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza pedrobaeza merged commit d10fb5e into OCA:12.0 Feb 15, 2019
@alexey-pelykh alexey-pelykh deleted the 12.0-add-hr_utilization_report branch February 15, 2019 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants