Analytic Parent Account
by Odoo DevHouse https://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse$ 50.00
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
| Lines of code | 183 |
| Technical Name |
analytic_parent_account |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse |
| Versions | 18.0 19.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
| Lines of code | 183 |
| Technical Name |
analytic_parent_account |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse |
| Versions | 18.0 19.0 |
Analytic Parent Account
Build hierarchical analytic account trees, customize display names with Python, and view consolidated cost & revenue across all child accounts - from a single parent.
In standard Odoo, analytic accounts exist in a flat list with no true operational parent-child hierarchy. Odoo introduced Analytic Account Groups for reporting hierarchy, but groups cannot record transactions - they are display-only. Additionally, the display name of any analytic account cannot be customized, making it hard to identify accounts in complex setups.
- No operational parent analytic account - groups cannot post transactions
- Display names are fixed - no customization or formatting possible
- Viewing all cost/revenue under a department or project requires manual filtering
- Analytic distribution dropdowns show raw names with no context or hierarchy
- Cannot search analytic accounts by a custom or computed display name
- No visual indicator of how many sub-accounts exist under a parent
This module adds a Parent Analytic Account field to every analytic account, enabling a true operational parent-child hierarchy where both parent and child accounts can record transactions. The parent automatically shows a consolidated cost/revenue view that includes its own lines plus all children's lines. A Python code engine in Settings ->Analytics lets you define any display name format - and Odoo's analytic distribution dropdown and list views search by your custom display name instantly.
- Parent Analytic Account Field: Assign any analytic account as a parent - both parent and child can still post transactions
- Child Accounts Smart Button: Parent form shows a stat button with the count of direct children - click to open the filtered list
- Auto Display Name: When a parent is set, display name automatically formats as Child / Parent - no manual entry needed
- Python Code Engine: Enable custom Python in Settings ->Analytics to define any display name formula using account fields
- Consolidated Cost / Revenue: Parent account aggregates its own analytic lines plus all descendants - full rollup in one view
- Search by Display Name: The custom display name is stored and indexed - searchable in list view and analytic distribution pickers
- List View Column: Optional Display Name column in the analytic accounts list for quick comparison
- Self-Reference Guard: Validation error prevents setting an account as its own parent - no circular loops
- Live Recompute: Changing Python code in Settings immediately recomputes all analytic display names system-wide
Default (Parent Set)
Example: Account = "Social Ads", Parent = "Marketing"
->Display: "Social Ads / Marketing"
No Parent
Example: Account = "Marketing"
->Display: "Marketing"
Python Mode
Example: Code = "MKT", Name = "Marketing"
->Display: "[MKT] Marketing"
Python Code Examples - Set in Settings ->Analytics
| Goal | Python Code | Result |
|---|---|---|
| Add suffix to all accounts | result = analytic.name + " DVH" | Marketing DVH |
| Prefix with code if available | result = '['+analytic.code+'] '+analytic.name if analytic.code else analytic.name | [MKT] Marketing |
| Show parent/child path | result = analytic.name+' / '+analytic.parent_id.name if analytic.parent_id else analytic.name | Social Ads / Marketing |
| Show partner name | result = analytic.name+' ('+analytic.partner_id.name+')' if analytic.partner_id else analytic.name | Project Alpha (Acme Corp) |
(Optional) Configure Python Display Name - Settings ->Analytics
Go to Settings ->Analytics, tick Analytic Distribution Python Code,
and write your Python formula. Set result to the desired display string using
analytic.name, analytic.code, analytic.parent_id.name,
or analytic.partner_id.name. Save - all accounts recompute instantly.
Create a Parent Analytic Account
Go to Accounting ->Configuration ->Analytic Accounts and create an account that will serve as the parent (e.g. Marketing Department). Leave the Analytic Parent field empty - this is a top-level account. Save.
Create Child Analytic Accounts and Assign Parent
Create child accounts (e.g. Social Ads, Email Marketing) and set the Analytic Parent field to Marketing Department. The Display Name field auto-fills as Social Ads / Marketing Department. Both parent and children can record transactions independently.
Use Custom Display Names in Analytic Distribution
Open any Sales Order, Purchase Order, Invoice, or Journal Entry and click the Analytic Distribution field. Type part of the custom display name (e.g. "Social") - the dropdown searches by your computed display name, not just the raw account name. Select the matching account and confirm.
View Consolidated Cost / Revenue on the Parent Account
Open the parent analytic account (Marketing Department). The cost and revenue figures include its own analytic lines plus all children's lines - one consolidated view for the entire department. The Children stat button shows the count of direct sub-accounts; click to navigate to them.
Step 1 - Enable Python Code in Settings ->Analytics
Tick Analytic Distribution Python Code and write your formula. The code editor supports all analytic account fields and uses Odoo's safe_eval engine.
Step 2 - Analytic Accounts List with Display Name Column
The list view shows the optional Display Name column alongside the account name. Accounts with parents show the formatted Child / Parent breadcrumb automatically.
Step 3 - Analytic Account Form: Parent Field and Display Name
The form view now has an Analytic Parent field and a read-only Display Name field that updates automatically based on the parent and Python settings.
Step 4 - Search by Custom Display Name in Analytic Distribution
When selecting an analytic account in order lines or journal entries, the dropdown searches by your custom display name - including Python-computed names and parent/child paths.
Step 5 - Children Smart Button on Parent Account
The parent account form shows a Children stat button with the count of direct sub-accounts. Click it to open the filtered list of all child analytic accounts.
Step 6 - Consolidated Cost / Revenue on Parent Account
The parent account's cost and revenue figures roll up all children's analytic lines automatically. One view for the total department or project cost/revenue - no manual aggregation required.
Department Cost Tracking
Create Marketing as parent with children Social Ads, Email, Events. View total marketing spend from the parent - drill down to each channel.
Project Sub-Task Analytics
Model a project with phases - Project Alpha as parent, Design, Dev, QA as children. See total project cost consolidated from all phases.
Geographic Region Hierarchy
Organize by region: MENA ->Gulf ->UAE, KSA. Revenue rolls up from country accounts to the regional parent automatically.
Product Category Costing
Track costs per product category with a parent like Electronics and children per SKU line - useful for product margin analysis across a multi-SKU portfolio.
Multi-Team Budget Control
Each team (Sales, Operations, Finance) has its own analytic account under a Headquarters parent - one dashboard shows company-wide cost in real time.
Branded Display Names
Use Python code to append a company suffix (Project Alpha - DVH) or prefix with the account code ([MKT] Marketing) for consistent naming across all users.
Installation & Configuration
- Prerequisites: Requires standard Odoo modules
analyticandaccount- available on both Community and Enterprise - Install: Copy the module to your addons path, then install via Apps ->Update App List ->Search "Analytic Parent Account"
- (Optional) Enable Python Code: Go to Settings ->Analytics and tick Analytic Distribution Python Code - write your formula and save
- Create Parent Accounts: Go to Accounting ->Configuration ->Analytic Accounts and create top-level parent accounts (no parent set)
- Create Child Accounts: Create child accounts and set the Analytic Parent field - display names auto-update immediately
- Test: Create a Sale Order or Journal Entry ->open the Analytic Distribution picker ->type part of the display name ->confirm it appears correctly
Demo Data: The module ships with demo analytic accounts showing a department hierarchy (Marketing ->Social Ads, Email Marketing) and a project hierarchy (Project Alpha ->Design, Development, QA) - activate demo mode to explore.
Clear Financial Hierarchy
Structure departments, projects, regions, and cost centers in a logical tree that mirrors your organization - no workarounds or manual aggregation needed.
Custom Names for Clarity
Python-powered display names let you format account identifiers consistently across the entire company - reducing errors when selecting accounts in analytic distribution.
Instant Consolidated Reporting
Open any parent account and see the total cost and revenue from all children - no pivot tables, no manual totals, no waiting for an export.
Faster Account Selection
Searching by display name in analytic distribution means users can type a meaningful keyword - not an arbitrary code - and find the right account immediately.
Need Help or Have a Feature Request?
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