Product margin analysis

Measure revenue, cost, and margin performance by product using posted customer and vendor invoice data.

The product_margin module adds a product-level analysis layer that compares sales turnover, purchasing costs, and the gap between actual values and standard pricing assumptions. It is useful for accountants, sales managers, and product owners.

Because the report is built from invoice data, it reflects financially recorded reality rather than just list prices or planning assumptions.

Margin
Turnover
Cost
Invoices
Reporting

Core indicators

FieldsTrường dữ liệuDescription
TurnoverDoanh thuTotal sales invoice value after discount.
Total CostTổng chi phíTotal purchasing cost taken from vendor invoices after supplier discounts.
Total MarginLợi nhuận thực tếActual margin calculated from real turnover minus real cost.
Expected MarginLợi nhuận kỳ vọngTheoretical margin based on expected sales and standard cost.
Sales GapChênh lệch doanh thuDifference between expected sales value and actual turnover.
Purchase GapChênh lệch chi phíDifference between standard cost and actual purchasing cost.

Opening the margin report

Steps

  • 1. Go to Sales → Reporting → Product Margins or Inventory → Reporting → Product Margins.

  • 2. Choose the From and To dates for the analysis period.

  • 3. Select Invoice State according to the invoice completion level you want included.

  • 4. Click Open to load the product list with margin metrics.

Meaning of Invoice State options

StateIncludesBest use case
PaidFully paid invoices onlyCash-realized or fully settled profit analysis
Open and PaidPosted invoices including unpaid and paidOperational commercial analysis of live invoice activity
Draft, Open and PaidBoth draft and posted invoicesPipeline review before close or broader forecasting

How to read sales indicators

Sales-side metrics

MetricInterpretationNotes
# Invoiced in SaleTotal product quantity on sales invoicesCredit notes can reduce the net quantity
Avg. Sale Unit PriceAverage selling unit priceTurnover divided by invoiced sale quantity
TurnoverActual realized sales valueDiscounted and converted to company currency
Expected SaleRevenue if sold at list priceUseful as a benchmark against real selling behavior
Sales GapDifference between expected sale and actual turnoverHelps spot discounting or above-list sales

How to read purchase indicators

Purchase-side metrics

MetricInterpretationNotes
# Invoiced in PurchaseTotal quantity recorded on vendor-side invoicesUsually includes bills and refunds per report logic
Avg. Purchase Unit PriceAverage purchase unit priceShows the real average sourcing price
Total CostActual purchasing costReflects supplier discounts
Normal CostStandard cost benchmarkComputed from standard product cost
Purchase GapDifference between standard and actual costHelps detect favorable or unfavorable sourcing outcomes

Important margin formulas

Margin formulas

MetricFormulaManagement meaning
Total MarginTurnover - Total CostActual commercial margin from recorded transactions
Total Margin RateTotal Margin / Turnover × 100Actual profit rate
Expected MarginExpected Sale - Normal CostReference margin under standard pricing assumptions
Expected Margin RateExpected Margin / Expected Sale × 100Reference rate for comparing with actual performance

Filtering and business analysis

Key points

  • • Use List View to isolate profitable or loss-making products and compare multiple metrics side by side.

  • • Use Graph View to understand trends by category, product, or salesperson.

  • • Grouping by Category helps reveal which product families generate the strongest margin and which dilute it.

  • • Filtering on Total Margin < 0 is a quick way to identify loss-making products in a chosen period.

  • • Large Sales Gap values may indicate heavy discounting or outdated list pricing.


Common real-world use cases

Typical analysis scenarios

ScenarioHow to read the reportSuggested action
Find loss-making products in a quarterFilter Total Margin < 0 for the target periodReview sales price, supplier cost, or decide whether to retire the product
Detect excessive discountingCompare Expected Sale against Turnover and monitor Sales GapReview discount policy or update list pricing
Identify top-profit productsSort by Total Margin descendingPrioritize marketing, stock availability, and sourcing for strong performers
Compare margin by categoryGroup by CategoryInvest more in stronger categories and fix weaker ones

Data and performance notes

Key points

  • • The report is driven by account.move invoice data, so uninvoiced orders are not directly represented.

  • • All numbers are converted into the company currency, so exchange rates should be maintained properly.

  • • Several metrics are computed fields and depend on date context, which is why results change with report filters.

  • • For large datasets, narrowing the analysis window improves query speed and usability.