| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) • Purchase (purchase) • Invoicing (account) |
| Lines of code | 259 |
| Technical Name |
stock_analytic_split |
| License | LGPL-3 |
| Website | https://github.com/haythamafify |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Inventory (stock)
• Discuss (mail) • Purchase (purchase) • Invoicing (account) |
| Lines of code | 259 |
| Technical Name |
stock_analytic_split |
| License | LGPL-3 |
| Website | https://github.com/haythamafify |
📦 Stock Analytic Distribution
Bring the power of analytic accounting directly to your stock transfers. Split costs across multiple analytic accounts — the same way you do on invoices. Now with auto-sync from Purchase Orders and Sales Orders — analytic is pulled automatically from the source document.
🆕 New in v4 — Auto-Sync from PO / SO
When a receipt or delivery is linked to a Purchase Order or Sales Order, the analytic distribution is pulled automatically from each order line and applied to the matching stock move. The field is locked to prevent manual override — ensuring data integrity. For standalone transfers (no PO/SO), manual entry remains fully available.
Key Features
🎯 Analytic Widget on Move Lines
The native
The native
analytic_distribution widget appears on every product line in your transfer form — exactly like invoice lines.
🔄 Auto-Sync from PO / SO Lines (NEW)
Each stock move inherits the analytic from the matching PO or SO line automatically. Field is locked when linked to a source document.
Each stock move inherits the analytic from the matching PO or SO line automatically. Field is locked when linked to a source document.
✏️ Manual Entry for Standalone Transfers
Internal transfers and receipts with no PO/SO remain fully editable — set cost center manually per line or via the header field.
Internal transfers and receipts with no PO/SO remain fully editable — set cost center manually per line or via the header field.
✅ Auto Analytic Lines on Validate
When you validate a transfer, analytic lines are automatically created for each distribution percentage on every done move.
When you validate a transfer, analytic lines are automatically created for each distribution percentage on every done move.
🔗 Full Stock Traceability
Analytic lines are linked back to
Analytic lines are linked back to
stock.move and stock.picking for full operational traceability.
🌍 Arabic Translation + Multi-Plan
Full Arabic
Full Arabic
i18n/ar.po translation included. Supports multiple analytic plans and percentage splits simultaneously.
How It Works
- Set Analytic on PO/SO Line — In your Purchase Order or Sales Order, set the Analytic Distribution on each product line (requires Analytic Accounting enabled in Settings).
- Confirm the Order — Odoo creates the linked receipt or delivery automatically.
- Analytic Auto-Applied — Open the receipt/delivery and find the analytic already filled from the source document. Field is locked.
- Validate — Click Validate. Analytic lines are created automatically per distribution.
- Standalone Transfers — For transfers without PO/SO, set the analytic manually on the header or per line and validate normally.
Technical Notes
- Auto-sync uses
stock.move.purchase_line_idandstock.move.sale_line_idto match move → order line. - Works safely with or without
sale_stockmodule installed —sale_idis checked dynamically. - Header analytic stored as JSON in
stock.picking.analytic_distribution. - Per-line analytic uses
stock.move.analytic_distribution. - Cost source uses
stock_valuation_layer_ids.value; falls back tostandard_price × qty. - Open Source — LGPL-3 license.
Dependencies
stock
analytic
stock_account
purchase_stock
Changelog
- v4.0.0 — Auto-sync analytic from PO/SO lines to stock moves. Field locked when linked to source document. Safe detection of sale_stock module.
- v3.0.0 — Header-level Default Analytic field that propagates to all lines automatically.
- v2.0.0 — Per-line analytic distribution widget with auto analytic line creation on validate.
- v1.0.0 — Initial release.
👤 Author
Haytham Afify | haythamgamal6@gmail.com
🐙 GitHub: github.com/haythamafify | 💼 LinkedIn
Haytham Afify | haythamgamal6@gmail.com
🐙 GitHub: github.com/haythamafify | 💼 LinkedIn
Please log in to comment on this module