Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to render organizational chart in any view?

Subscribe

Get notified when there's activity on this post

This question has been flagged
viewschartDocker13
1 Reply
5904 Views
Avatar
Ian Riva B

On the hr_employee module, under the employee directory, in the form view there is a organizational chart (that can be turned on and off from the settings). 

I have a model that inherits from hr.employee and my goal is to render the same chart in my new view. In the hr.employee views there is a div in the forms where should render the chart, but it's empty.

From the hr_employee view:

------------

<page name="public" string="Work Information">

                                <div id="o_work_employee_container"> <!-- These two div are used position org_chart -->

                                    <div id="o_work_employee_main">

                                        <group string="Location">

                                            <field name="address_id"

                                                context="{'show_address': 1}"

                                                options='{"always_reload": True, "highlight_first_line": True}'/>

                                        </group>

                                        <group name="managers" string="Responsibles">

                                            <field name="coach_id"/>

                                        </group>

                                        <group string="Schedule" groups="base.group_no_one">

                                            <field name="resource_calendar_id"/>

                                        </group>

                                    </div>

                                </div>

                            </page>

------------

I tried to use the same divs but nothing is rendered, how can I use the same chart?


The form view:

------------

<record id="employee_details_form" model="ir.ui.view">

        <field name="name">Detalles empleado</field>

        <field name="model">hr.employee</field>

        <!--<field name="inherit_id" ref="hr_employee.hr_employee_public_view_form"/>-->

        <field name="arch" type="xml">

            <form string="Employee Details Form">

                <header>

                    <button name="test_method" string="Test button" type="object" attrs="" class="oe_highlight" />

                    <button name="calculate_salary" string="Calcular salario" type="object" attrs="" class="oe_highlight" />

                    <button name="calculate_all_salaries" string="Calcular todos los salarios" type="object" attrs="" class="oe_highlight" />

                </header>

                <sheet>

                    <div class="oe_title">

                        <h1>

                            <field name="name" />

                        </h1>

                    </div>

                    <group>

                        <group>

                            <field name="company_id" />

                            <field name="commercial_plan_id" />

                            <field name="parent_id" />

                        </group>

                        <group>

                            <field name="child_all_count" />

                            <field name="phone" />

                            <field name="sex" />

                        </group>

                    </group>

                    <group>

                        <field name="salary_type" />

                        <field name="base_salary" />

                        <field name="last_payment" />

                    </group>

                    <group>

                        <div id="o_employee_right">

                            <h4 class="o_org_chart_title mb16 mt0">Organization Chart</h4>

                            <field name="child_ids" widget="hr_org_chart" />

                        </div>

                    </group>

                    <notebook>

                        <page string="Pólizas">

                            <field name="policy_ids" />

                        </page>

                        <page string="Pagos">

                            <field name="payment_ids" />

                        </page>

                        <page string="Subordinados directos">

                            <field name="child_ids" />

                        </page>

                        <page string="Notas extra">

                            <field name="observation" />

                        </page>

                    </notebook>

                </sheet>

            </form>

        </field>

    </record>

------------

In the browser:

https://imgur.com/19AfU6M

0
Avatar
Discard
Avatar
Jainesh Shah(Aktiv Software)
Best Answer

Hello  Ian Riva B,

You have to add child_ids field in you form view

                <div id="o_employee_right">

                    <h4 class="o_org_chart_title mb16 mt0">Organization Chart</h4>

                    <field name="child_ids" widget="hr_org_chart"/>

                </div>

add above code at your page.

Thank You!


Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

    

1
Avatar
Discard
Ian Riva B
Author

Hi, thanks for your answer, but the code above it's rendering a list, do you know why? I edited the original answer with the code of my view and a screenshot.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Create split view of list of objects | object content
views 13
Avatar
0
Jan 21
2826
Dynamic Form from Tree View Solved
action views 13
Avatar
Avatar
Avatar
3
Aug 20
5086
[Odoo SH] How to hide "create invoice" button Solved
views accessrights odoo.sh 13
Avatar
Avatar
2
Mar 21
4294
Select multiple elements with XPath Solved
views
Avatar
Avatar
Avatar
Avatar
Avatar
5
Aug 24
48220
How to automate initial configuration? Solved
13
Avatar
Avatar
Avatar
Avatar
4
Feb 24
7993
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now