| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Sales (sale_management)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 1428 |
| Technical Name |
och_sale_price_formula |
| License | OPL-1 |
| Website | https://www.och-web.com/ |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Sales (sale_management)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 1428 |
| Technical Name |
och_sale_price_formula |
| License | OPL-1 |
| Website | https://www.och-web.com/ |
Stop calculating prices in Excel.
Quote inside Odoo.
Product Formula Pricing — custom price formulas on sale order lines, with audit trail and pricelist integration.
Your products have a price that depends on dimensions, options or finish levels. Odoo cannot compute it natively, so your sales team drops into Excel for every quote. This module adds the missing pricing layer between your catalog and your pricelist — every quote stays in Odoo, every price is auditable, every margin is protected.
What this Excel side-process is really costing you
In most SMBs that sell made-to-order or configurable products, the real quoting flow looks like this: salesperson opens Excel, computes the price from customer inputs, types the result back into Odoo. It feels harmless. It is not.
|
5–15 min
lost per quote on calculations that could be automated |
1 typo
can ship a quote below your actual cost. Margin gone, undetected. |
0 trace
in Odoo of how that price was calculated. Impossible to audit later. |
∞ sheets
in circulation, each salesperson keeping their own version |
The problem isn't your sales team — it's that Odoo's native pricelist engine has no parametric layer between the catalog price and pricelist rules. The team is forced to work outside the ERP. This module adds that missing layer.
Key features
|
|
||||
|
|
||||
|
|
How it works
Define a formula
Go to Sales > Configuration > Price formulas, declare variables and write a short Python body.
Attach to a product
On the product template, Sales tab, pick the formula in the Extra info group.
Sell
On the quotation, pick the product: the configurator opens, users fill the variables, price is computed live.
Screenshots
1. Formula definition
Define variables (integer or selection) directly on the formula form, with sequence, coefficient and default values.
2. Sale order configurator
On each order line, a configurator collects the values with a live price preview and an Apply button.
3. Order line integration
A discrete calculator button reopens the configurator anytime. Variable values are printed in the line description for a clean document.
4. Python editor with safe symbols
Full-featured Ace editor. A cheat sheet lists all available symbols. Every save compiles and dry-runs the code.
Formula examples
A few real-world snippets you can copy/paste into your formula body.
# Surface-based pricing (m2) width = vars.get("width", 0) length = vars.get("length", 0) result = list_price * width * length
# Weighted tier (Selection variable) # 1.0 = Standard / 1.25 = Premium / 1.5 = Platinum result = list_price * vars.get("tier", 1.0)
# Customer-specific minimum price base = list_price + vars.get("extra", 0) minimum = 50.0 if partner and partner.customer_rank else 25.0 result = max(base, minimum)
Available symbols in formulas
| Symbol | Type | Description |
|---|---|---|
product | product.product | The variant being priced. |
template | product.template | Shortcut for product.product_tmpl_id. |
list_price | float | Catalog sale price of the variant. |
vars | dict | Variable code -> numeric value. |
qty | float | Order line quantity. |
uom | uom.uom | Unit of measure of the line. |
partner | res.partner | Order customer (may be empty in preview). |
pricelist | product.pricelist | Pricelist (may be empty in preview). |
result | float (output) | Assign the final base price to this variable. |
Who is this for?
Built for SMBs whose products do not have a fixed price — every quote is different.
🏗️ Carpentry & cabinet-makingPrice per m² varying by wood species, dimensions, finish. Variables: width, length, material coefficient |
🖼️ Print & signagePrice varying by format, substrate, ink type, finishing. Variables: width, height, support (selection), finishing |
🪓 Glaziers & mirror makersMade-to-measure glass with thickness and safety treatment. Variables: width, height, thickness, treatment (selection) |
🧹 Embroidery & textile customisationPer-piece price varying by colour count and pattern complexity. Variables: colour count, complexity (selection) |
💼 Consulting & training servicesDaily rate scaled by consultant seniority and travel mode. Variables: days, seniority (selection), travel (selection) |
⚙️ Metalwork & fabricationPrice per kilo varying by steel grade and thickness. Variables: weight, grade (selection with coefficients) |
Your industry isn't listed above? If your products have variable pricing inputs, the module adapts to your calculation logic.
Security model
No custom group to configure. The module reuses Odoo's built-in Sales groups, so your existing user assignments already work.
Sales / Salesperson
- Sells formula products on quotations & orders
- Opens the configurator on sale lines
- Sees the live price preview as values change
- Read-only on formulas — cannot see or run Python code (field-level restriction)
Sales / Administrator
- Everything a salesperson can do
- Creates, edits and archives formulas
- Defines variables (integer / selection) and their options
- Writes and reads the Python source code
- Save-time validation: syntax + dry-run with defaults
🛡️ safe_eval sandbox
Every formula runs inside Odoo's safe_eval with a restricted opcode set:
- No
import/ no__import__/ noexec/ noeval - No file system access, no network, no Python builtins beyond a safe subset
- Attribute walks to dangerous internals (
__class__.__bases__...) blocked - If a formula fails at runtime, the sale line displays a red error and confirmation of the quotation is blocked — no silent 0 € orders
Quality & compatibility
Odoo 18 (CE & EE)
Unit tests
Translations
License
Need help or a custom formula?
OCH provides Odoo consulting, custom development and ongoing support.
© 2026 OCH — Olimalt CHAHIDOV. All rights reserved.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module