[ADD] sale_timesheet_costs_revenues: costs and revenues pivot report#936
Open
innovara wants to merge 1 commit into
Open
[ADD] sale_timesheet_costs_revenues: costs and revenues pivot report#936innovara wants to merge 1 commit into
innovara wants to merge 1 commit into
Conversation
fe8c7e2 to
a507ca3
Compare
Add a read-only pivot under Project > Reporting that shows, per project and period, the hours logged on time-and-material work, their cost, and the billable value of that time split into untaxed amount to invoice and untaxed amount invoiced. Data is exposed through a SQL view over the timesheet (analytic) lines, enriched with the linked sale order line. The billable value is the timesheet duration, converted into the sale order line's unit of measure, times its price less discount; it counts as to invoice until the timesheet is linked to an invoice, then as invoiced, so the figures update live as time is logged and billed. Inspired by the "Project Costs and Revenues" report available under Project > Reporting in Odoo 14.0 and earlier. Signed-off-by: Manuel Fombuena <mfombuena@innovara.tech>
a507ca3 to
f881740
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A pivot report under Project > Reporting of billed and unbilled timesheet value for time-and-material projects, alongside the cost of the time logged.
Per project and period it shows the hours logged, their cost, and the billable value of that time split into Untaxed Amount to Invoice and Untaxed Amount Invoiced. The timesheet date drives the period grouping, and the usual
dimensions (project, customer, analytic account, product, sale order, sale order line, project manager/company/currency, and sales order confirmation date) are available as pivot rows/columns.
It is inspired by the Project Costs and Revenues report that was available under Project > Reporting in Odoo 14.0 and earlier, and removed in later versions.
How it works
Data is exposed through a SQL view over the timesheet (analytic) lines, enriched with the linked sale order line, so figures update live as time is logged and invoiced. Hours and cost come straight from the analytic line. The billable value is the timesheet duration — converted into the sale order line's unit of measure — times its unit price, less the line discount; it counts as to invoice while the timesheet is uninvoiced and as invoiced once it is linked to an invoice.
Notes for reviewers
(
qty_delivered_method in ('timesheet', 'manual')). Fixed-price and milestone lines still contribute cost and hours, but no revenue.account.analytic.lineis referenced defensively:init()checks the column exists before building the view, so the report degrades gracefully rather than failing if an install has reworked analytic plans.Tested on