| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Sales (sale_management)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 196 |
| Technical Name |
sale_price_control |
| License | LGPL-3 |
| Versions | 17.0 18.0 19.0 |
đ Sale Price Control
Prevent sale orders from being confirmed when prices are below cost â requires password authorization from authorized users before proceeding.
đ Overview
Sale Price Control adds a critical business safeguard to your Odoo sales workflow. When a salesperson clicks "Confirm" on a sale order, the module checks every order line to see if the unit price is below the product's cost price.
If any below-cost lines are found, confirmation is blocked and a password authorization wizard appears. Only users belonging to the "Allow Below Cost Price" security group â who have configured their personal override password â can authorize the confirmation.
â Key Features
- â Below-Cost Detection: Automatically checks all order lines â compares unit price against product cost (standard_price)
- â Password Authorization Wizard: Blocks order confirmation and shows a wizard with detailed below-cost line info
- â Security Group: Dedicated "Allow Below Cost Price" group â only members can authorize overrides
- â Per-User Password: Each authorized user has their own password set in their Preferences
- â Approval Tracking: Each line gets a "Price Override Approved" flag â so approved lines are not rechecked
- â Auto-Reset Approval: Approval is automatically cleared if the price, product is changed
- â 100% Server-Side: No JavaScript or browser-side code â reliable, no cache issues
- â Clear Error Messages: Specific validation messages for missing password, wrong password, or missing group
⥠How It Works
|
â
Click Confirm Salesperson confirms SO |
â |
đ
Check Prices Compare vs cost price |
â |
đ
Wizard Opens Shows lines + asks password |
â |
đ
Authorize Password OK â order confirmed |
Validation Checks (in order)
| Check | Error If Failed |
|---|---|
| 1. Password entered? | "Please enter a password." |
| 2. User in "Allow Below Cost Price" group? | "You do not belong to the Allow Below Cost Price group." |
| 3. User has a password configured? | "No price override password is configured for your user." |
| 4. Password matches? | "Incorrect password." |
đĨ Installation
Requirements
| Requirement | Details |
|---|---|
| Odoo Version | 18.0 (Community & Enterprise) |
| Depends On |
sale_management,
product,
|
| Python Libraries | None |
| License | LGPL-3 |
Steps
| 1 | Upload the
module Copy sale_price_control
into your addons directory.
|
| 2 | Update app
list Go to Apps â Update Apps List |
| 3 | Install Search for "Sale Price Control" and click Install. |
âī¸ Configuration
Two things need to be set up: group membership and password.
Step 1 â Assign the Security Group
| 1 | Go to Settings â Users & Companies â Users |
| 2 | Select the user (e.g. Sales Manager) |
| 3 | Under the Sale Price Control section, enable "Allow Below Cost Price" |
Step 2 â Set the Override Password
| 1 | On the same user form, go to the Preferences tab |
| 2 | Find the "Sale Price Override" section (only visible for group members) |
| 3 | Enter and save the Price Override Password (displayed as dots for security) |
đ Usage
Scenario: Confirming an Order with Below-Cost Prices
| 1 | Create a Sale Order and add products. Set a price below cost on one or more lines. |
| 2 | Click "Confirm". Instead of confirming, a wizard popup appears. |
| 3 | The wizard shows all below-cost lines with product name, unit price, and cost price. |
| 4 | Enter your price override password. |
| 5 | Click "đ Authorize & Confirm Order". If the password is correct, the lines are marked as approved and the order is confirmed. |
What the Wizard Shows
Gadget Y [Box]: Unit Price 45.00 â Cost Price 50.00
Approval Auto-Reset
If a line has been approved but then one of the following is changed, the approval is automatically cleared and the check will trigger again on the next confirmation:
- âē Unit Price changed (via UI or direct write)
- âē Product changed
â Frequently Asked Questions
Can a regular salesperson bypass the check?
No. The wizard requires both group membership and a correct password. Without both, the order cannot be confirmed with below-cost prices. The salesperson must either fix the prices or ask an authorized user to enter the password.
What if a product has zero cost price?
Products with cost = 0 are skipped. The check only triggers when
standard_price >
0 and price_unit
< standard_price.
Is the override password stored securely?
The password is stored as plain text in the database (like many Odoo
configuration passwords). It is displayed as dots in the UI via the password="True"
widget. This is an authorization PIN, not a login credential.
Does this require any JavaScript?
No. The module is 100% server-side Python + XML. No JS assets, no browser cache issues, no frontend dependencies.
đ¤ Support
For questions, bug reports, or feature requests:
./odoo-bin
-u sale_price_control -d your_database
Please log in to comment on this module