| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Purchase (purchase)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 467 |
| Technical Name |
purchase_margin_calculator |
| License | OPL-1 |
| Website | https://github.com/neurodev-apps |
| Versions | 16.0 17.0 18.0 19.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Purchase (purchase)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 467 |
| Technical Name |
purchase_margin_calculator |
| License | OPL-1 |
| Website | https://github.com/neurodev-apps |
| Versions | 16.0 17.0 18.0 19.0 |
Purchase Margin Calculator
Track real purchase cost, convert UoM automatically, and monitor margin health
The Problem
You buy products in kg but sell them by unit. Odoo shows you a cost per kg and a sale price per unit — comparing them gives you a meaningless margin. Existing modules either only show cost on PO lines (not on the product), or worse, overwrite standard_price breaking your AVCO/FIFO valuation.
Key Features
UoM Conversion
Automatically converts purchase price to the product's sale UoM. Buy in kg, sell by unit — margin is always correct.
POS Price Detection
If Point of Sale is installed, uses the POS pricelist price for margin calculation. Works with and without POS — no extra dependency.
Price History
Keeps a rolling history of the last 10 purchases per product. See price trends, vendors, and UoM at a glance.
Margin Alerts
Color-coded semaphore (OK / Warning / Critical / No Data) on every product. Configurable target factor per company in Settings.
Safe — No Overwrites
Does NOT modify standard_price. Your inventory valuation (AVCO, FIFO, Standard) remains untouched. 100% safe.
Multi-Company
Each company can set its own target margin factor. Purchase history is filtered by company.
How It Works
- Confirm a Purchase Order → the module records the line price, vendor, UoM, and date.
- The purchase price is converted to the product's sale UoM.
- Margin is calculated against the effective sale price (POS pricelist or list price).
- A suggested price is computed using your configured margin factor.
- The semaphore alerts you immediately if margin is below target.
- A scheduled cron keeps all products up to date.
Product Form — New Tab
A dedicated "Purchase Cost & Margin" tab is added to every product, showing last purchase info, margin analysis with semaphore, and price history table.
Product List — At-a-Glance Columns
Optional columns in the product list: Last Cost, Suggested Price, Margin %, and Alert. Enable them via the column selector.
Configuration
Go to Settings > Purchase and set your Target Margin Factor. Default is 1.30 (30% margin). Change it per company as needed.
Technical Details
- Supported Versions: 16.0, 17.0, 18.0, 19.0 (Community & Enterprise)
- Dependencies: product, purchase
- Optional: point_of_sale (auto-detected, not required)
- New model: purchase.price.history
- Cron: Batch recalculation daily
- Post-install hook: Populates history from existing POs automatically
- License: OPL-1
Support
Need help? Contact us at neurodev.odoo@gmail.com
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