Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to render organizational chart in any view?

Odoberať

Get notified when there's activity on this post

This question has been flagged
viewschartDocker13
1 Odpoveď
5914 Zobrazenia
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
Zrušiť
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
Zrušiť
Ian Riva B
Autor

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!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Create split view of list of objects | object content
views 13
Avatar
0
jan 21
2830
Dynamic Form from Tree View Solved
action views 13
Avatar
Avatar
Avatar
3
aug 20
5099
[Odoo SH] How to hide "create invoice" button Solved
views accessrights odoo.sh 13
Avatar
Avatar
2
mar 21
4304
Select multiple elements with XPath Solved
views
Avatar
Avatar
Avatar
Avatar
Avatar
5
aug 24
48226
How to automate initial configuration? Solved
13
Avatar
Avatar
Avatar
Avatar
4
feb 24
7996
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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