OCA / timesheet

Odoo Timesheet Management Addons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFC] hr_timesheet_employee_billability

max3903 opened this issue · comments

@alexey-pelykh I assigned this issue to you because I looked at various modules of this repo and you are listed as the maintainer.

I need to provide a dashboard with timesheets report including information like:

Employee Total Total Billable Total Non-Billable % Billable Average Billable / Day
Jane Smith 40 32 8 80 % 6.4
John Doe 40 32 8 80 % 6.4
Project Manager Total
Jane Smith 80

Is it something that can be achieved with the current modules? Which modules would you suggest?

If the development of new modules is required, how would you do it to make sure they are compatible with the existing ones and merged in the repo?

My approach would evolve around a SQL view (like sale.report) with:

  • Employee name: hr_employee.name
  • Department: hr_employee.hr_department
  • Duration: account_analytic_line.unit_amount
  • Billable: True if account_analytic_line.project_id.partner_id != user.company_id.partner_id, False otherwise
  • Project Manager: account_analytic_line.project_id.user_id
  • Date: account_analytic_line.date

and a pivot view with measures:

  • Total: Sum of duration
  • Total Billable: Sum of duration with Billable = True
  • Total Non-Billable: Sum of duration with Billable = False
  • Total % Billable: Total Billable x 100 / Total
  • Average Billable / Day: Total Billable / # of date

by default, grouped by employee and filtered by the current week.

What do you think?

Hey @max3903!

Is it something that can be achieved with the current modules? Which modules would you suggest?

As of right now, I don't know of any module that does exactly what you're looking for but hr_utilization_report and hr_utilization_analysis would be a good place to start.

My approach would evolve around a SQL view (like sale.report)

I would strongly suggest against SQL view approach in this case, as computation of real available time (that's 40 hours in your example) would be hard-next-to-impossible with pure SQL due to holidays, different work calendars, etc.

Billable: True if account_analytic_line.project_id.partner_id != user.company_id.partner_id, False otherwise

hr_utilization_report allows to split time A/B by a field with exactly Billable/Non-billable field (or any other field) in mind, that you could add in company-specific module.

Average Billable / Day: Total Billable / # of date

You'd find this measurement hard to implement for a multi-timezone company for sure.

filtered by the current week.

You'd find computation of Average Billable / Day: Total Billable / # of date impossible without knowing range of report (e.g. from wizard) beforehand.

If the development of new modules is required, how would you do it to make sure they are compatible with the existing ones and merged in the repo?

I'd start by looking into hr_utilization_report, it would do most of what you expect, given that you have employee position/role defined, etc. It does not have average for sure, even for A/B split, but that could be done by extension module, or by enhancing the hr_utilization_report, if proper generalization is done.

@alexey-pelykh @pedrobaeza Thank you! I will check those modules.

I think I will give a shot at adding billability measures to the "By Employee" report.

Description

This module adds measures of billability on the Employee timesheet pivot view:

  • Total Billable: Sum of duration if linked to a sale order line
  • Total Non-Billable: Sum of duration if not linked to a sale order line
  • Total % Billable: Total Billable x 100 / Total
  • Average Billable / Day: Total Billable / # of date

Usage

  • Go to Timesheets > Reporting > Timesheet > By Employee
  • Open the Measures drop down list
  • Select one of the measures described above

I have already added a PR,
Is there anything wrong ?

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.