Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

odoo-13 create treeview inside treeview

Subscriure's

Get notified when there's activity on this post

This question has been flagged
treeviewxmlodoo-13
1 Respondre
5198 Vistes
Avatar
Mohammed Salah

in odoo 10 its possible to create treeview inside treeview using view_type: 


 tree


for examble: 


                    Chart of Accounts            account.account                        tree                        [('parent_id','=',False)]            {'view_all': True}        

​



 and its will make parent child accounts view, something like this:


00000000

​1111111111

​ ​222222222

​ ​ ​33333333333


but this feature is dropped in odoo-13, is there are an alternative way to make similar view?

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

In Odoo 10, you can create a tree view inside another tree view by defining related fields and using the groups feature in the XML view definition. This allows you to display related records as a nested tree view within the parent tree view.

Here's a step-by-step guide on how to achieve this:

  1. Define Related Fields: First, you need to define related fields in your model. These related fields will establish the relationship between the parent and child records.For example, let's assume you have two models: parent.model and child.model. You want to display a list of related child.model records within the parent.model tree view. You would define a related field in the parent.model like this:

    from odoo import models, fields

    class ParentModel(models.Model):
        _name = 'parent.model'
        _description = 'Parent Model'

        name = fields.Char(string='Name')
        child_ids = fields.One2many('child.model', 'parent_id', string='Children')

    Define the Parent Tree View: In your XML view definition for the parent.model, define a tree view for it. Include the related field child_ids to display the related records.

<record id="view_parent_model_tree" model="ir.ui.view">
<field name="name">parent.model.tree</field>
<field name="model">parent.model</field>
    <field name="arch" type="xml">
        <tree>
<field name="name"/>
            <field name="child_ids" widget="one2many_list">
                <form string="Child Records">
                    <field name="field1"/>
                    <field name="field2"/>
<!-- Add more fields as needed -->
                </form>
            </field>
        </tree>
    </field>
</record>

  1. The widget="one2many_list" attribute tells Odoo to display the related records as a nested list view within the parent tree view.
  2. Define the Child Tree View (Optional): If you want to customize the tree view for the child.model, you can define a separate tree view for it in a similar way.
  3. Apply Security Groups (Optional): If you want to restrict access to certain records, you can use Odoo's security groups to control who can see the child records within the parent tree view.

Once you've defined the related fields and created the appropriate views, you should be able to see the child records displayed as a nested tree view within the parent tree view.

Keep in mind that this approach allows you to display related records in a nested fashion within the parent tree view. If you need more complex tree view structures, you might need to explore custom Odoo module development or consult with an Odoo developer for additional customization.


Hope it helps

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
How can I create treeview inside a treeview
treeview xml
Avatar
0
de juny 15
4460
Show history sale by partner by product
treeview xml
Avatar
0
de març 15
4339
select check box for tree view inside a form
treeview xml tree_view
Avatar
0
d’ag. 15
8918
How to create a new tree view for inherited(res.users) model without modifying the original view? v16
treeview xml inheritance odoo16features
Avatar
Avatar
1
d’oct. 23
3687
tree view issue editable="bottom"
treeview xml one2many attachments
Avatar
Avatar
Avatar
3
de març 24
27658
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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