OCA/sale-workflow · 18.0
Sale Order Line Final Price
sale_order_line_final_price
Sale Order Line Final Price
This module adds a Final Price field to sale order lines, holding the unit price once the discount is applied.
Setting it works out the discount that turns the price coming from the pricelist into the agreed figure, so the catalog price stays visible on the quotation and the rebate is recorded as such.
On top of that, the unit price and the discount become read only for anyone who is not a Sales Administrator: salespeople state what the customer pays, and the system works out the discount.
Table of contents
Use Cases / Context
Negotiations happen on the price the customer ends up paying, but a quotation where that figure has been typed straight into the unit price loses the only thing that tells you a rebate ever happened: the price of the catalog. The line then reads as if the product were worth what was agreed, the discount column stays at zero, and there is no way to tell a well priced deal from a heavily discounted one, neither on the printed quotation nor on any margin or discount report.
Odoo already has the right place to record that gap. The unit price is what the pricelist says the product is worth, and the discount is what was given away. So the list price is worth keeping untouched, and the discount is worth keeping as the only thing that moves.
The catch is that salespeople don't negotiate in percentages, and asking them to work out that 45.00 out of 49.90 is a 9.82% discount is asking for typos and for unit prices quietly edited down instead. This module closes that gap: the Final Price field takes the agreed figure, and the discount is derived from it, so the pricelist price stays on the line and the rebate is recorded as a rebate, without anybody having to compute anything.
Locking the unit price and the discount for everyone but a Sales Administrator is what keeps that invariant true. The two fields remain the record of what the catalog said and what was conceded.
Configuration
The discount is the only room the final price has to move in, so the
decimal precision of Discount is what says how exact the final price
can be. With the two decimals Odoo ships with, the leftover of the
rounding is at most unit price * 0.005 / 100 per unit, which stays
under a cent on a single unit but adds up with the quantity: 10 units of
a line priced at 30.75 amount to 549.99 instead of the 550.00 asked for.
Raising the decimal precision of Discount (Settings > Technical > Decimal Accuracy) to 5 or 6 digits drops that leftover below the cent for any sensible price and quantity, and the amounts of the line then add up to the final price.
Bear in mind that this precision rules every discount of the database, and that discounts with that many decimals will be printed as such unless the report is told otherwise.
Usage
On any sale order line, fill in Final Price with the unit price agreed with the customer. The discount is computed right away, keeping the unit price given by the pricelist: a final price of 750.00 over 1,000.00 gives a 25% discount. Editing the unit price or the discount refreshes the final price instead.
A line whose pricelist price is zero is the exception. No discount can ever lift that price up to the agreed figure, and there is no catalog price worth keeping either, so the final price is written straight into the unit price and the discount stays at zero.
The discount is the only figure that moves, so the final price can only be reached as close as the Discount decimal precision allows. When the requested figure is out of reach, the line settles for the closest one, and the final price shown is always what the line is really worth: asking for 333.33 over 1,000.00 gives a 66.67% discount, which is 333.30.
That leftover can also stay out of sight on the final price and still show up on the amount of the line: 30.75 with the -78.86% needed to reach 55.00 is 54.99945 per unit, so 10 units amount to 549.99 instead of 550.00. Raising the decimal precision of Discount narrows the gap.
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Authors
- Tecnativa
Contributors
- Tecnativa:
- Eduardo Ezerouali
- Pedro M. Baeza
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
Current maintainer:
This module is part of the OCA/sale-workflow project on GitHub.
You are welcome to contribute. To learn how please visit <https://odoo-community.org/page/Contribute>.






