Skip to main content

Set the final price of a sale order line, and lock its unit price and discount for non sales managers

Project description

Odoo Community Association

Sale Order Line Final Price

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

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.

Odoo Community Association

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:

eduezerouali-tecnativa

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_sale_order_line_final_price-18.0.1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_sale_order_line_final_price-18.0.1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 04f514af3a140c7be2765d998b1e78e46087d96e77d235bc57092d9b710332b6
MD5 234ac5bc6cea2157ba33baee269cdd28
BLAKE2b-256 640ec4b80b4c29d65136667d9ffbdf6e245b2a4c26d2ab778abd229e71ac130a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page