Computes sale order lines margins for the delivered items.
This module takes in consideration Outgoing and Returns.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Adds delivered margin figures to sales order lines and the sales analysis report, based on the actual cost of the goods that were shipped or returned.
This module extends sales order lines with three extra cost and margin figures that are calculated from the stock valuation of the products actually delivered, not just from the product's standard cost.
On a sales order line you get: - Cost Price dlvd.: the average unit cost of the delivered products. - Margin dlvd.: the total margin on the delivered quantity. - Margin dlvd. (%): the margin as a percentage of the unit price after discounts.
These columns are hidden by default and can be switched on from the optional columns menu. The percentage column is hidden when the line has no subtotal.
The calculation uses outgoing stock moves and customer returns (incoming moves flagged as refunds). For non-storable products it falls back to the purchase price. The figures are stored and recalculated automatically when the delivered quantity, the margin, or the related stock valuation changes.
The module also adds a delivered margin measure to the Sales Analysis report, so you can analyse delivered margin by customer, product, salesperson or period. It depends on the standard Sales Margin and Sales and Inventory modules.
Depends on
Required by other modules
Models and fields (2)
- sale.report · extends an existing modelmargin_delivered
- sale.order.line · extends an existing modelmargin_delivered, purchase_price_delivery, margin_delivered_percent
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 6 confirmed, 3 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/margin-analysis.
terminal Installation and usage
OCA documentation · Odoo 18.0Configuration
Source · Odoo 18.0To grant Sales Margin view privileges to a user, go to Settings \> Users & Companies \> Users, select the user and set Show Sale Margin on.
Usage
Source · Odoo 18.0- Go to Sales \> Orders \> Quotations.
- Create a new Sales Order and add a line with an stockable product. Set a quantity higher than one.
- Confirm the Sales Order and deliver just a partial amount of product in the picking.
- Go to Sales \> Reporting \> Sales and unfold the Order Reference dimension and the Margin and Margin Delivered to compare them.
For example:
In an order line with a product at a cost of 10 and a sell price of 25 we deliver 2 of 3 units. Then, the reported margins would be:
margin: 45 (3 * 15) margin_delivered: 30 (2 * 15)
Additionally, you can check the margin and the margin percent in the sales order line.
No verified information in OCA: Installation.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.