Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

how to add a tree view in openerp 7?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
treeviewone2manyobject
1 Răspunde
9674 Vizualizări
Imagine profil
sneha antony

I had developed a simple module student_info in my openerp 7.I have a form view in which I want to create a tree view having two columns Date and Status.The screen shot of view attachedScreenshot-1.png I want to have a grid with two columns Date and Status under the tab heading Student Status.My present xml file and py file are attached.

student_info.py

  from openerp.osv import osv, fields

class student_student(osv.osv):

_name = 'student.student'

_columns = {
'name':fields.char('Student Name',size=16,required = True,translate = True),
'age':fields.integer('Age',required = True),
'percent':fields.float('Percentage',help = 'This field will add average marks of students out of 100'),
'gender':fields.selection([('male','Male'),('female','Female')],'Gender'),
'active':fields.boolean('Active'),
'notes':fields.text('Details'),
}

_defaults = { 'name':'Atul',
      'active':True,
}
student_student()

student_info_view.xml

    <?xml version="1.0" encoding="utf-8"?>
 <openerp>
  <data>


    <!--Student search view-->
    <record model="ir.ui.view" id="student_search">
        <field name="name">student.search</field>
        <field name="model">student.student</field>
        <field name="type">search</field>
        <field name="arch" type="xml">
          <search string = "student information search">
            <field name="name" string = "Student Name"/>
            <field name="gender" string = "Gender"/>  
            <field name="age" string = "Age"/>
           </search>
        </field>
    </record>



      <!--Student tree View-->
      <record id="student_student_tree" model="ir.ui.view">
        <field name="name">student.result.tree</field>
        <field name="model">student.student</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
          <tree string="Student_result">  
            <field name="name"/>  
            <field name="age"/>
        <field name="percent"/> 
            <field name="gender"/>  
            <field name="active"/>
            </tree>
        </field>
    </record>


      <!--Student Form View-->
        <record id="student_student_form" model="ir.ui.view">
            <field name="name">student.result.form</field>
            <field name="model">student.student</field>
          <!--<field name="type">form</field>-->
            <field name="arch" type="xml">
              <form string="Student_result" version="7.0">  
              <sheet>
               <group>
                <group>
                 <field name="name" />
                 <field name="age" />
                 <field name="percent" />
                 <field name="gender" />
                 <field name="active" />
                 <field name="notes" /> 
              </group>
                </group>
            </sheet>
            </form>
            </field>
        </record>

      <!--Student Action-->
        <record id="action_student_student" model="ir.actions.act_window">
            <field name='name'>Student Information</field>
            <field name='res_model'>student.student</field>
            <field name='view_type'>form</field>
            <field name='view_mode'>tree,form</field>
        </record>

       <!--Student Menu-->
         <menuitem id="student_parent" name="student"/>
         <menuitem id="menu_student_parent" name="Student Management" parent="student_parent"></menuitem>
         <menuitem action="action_student_student" id="menu_student_student" parent="menu_student_parent"      string="Result"/>
             </data>
         </openerp>

What are the code changes to be made in the present files.I am very new to openerp and tried for a long time yet the syntax for treee view was not found.So any help is greatly appreciated.

0
Imagine profil
Abandonează
Imagine profil
Jagdish Panchal
Cel mai bun răspuns

Hi Try this

  <!--Student tree View-->
    <record id="student_student_tree" model="ir.ui.view">
        <field name="name">student.result.tree</field>
        <field name="model">student.student</field>
        <field name="arch" type="xml">
            <tree string="Student_result">  
                <field name="name"/>  
                <field name="age"/>
                <field name="percent"/> 
                <field name="gender"/>  
                <field name="active"/>
            </tree>
        </field>
    </record>
1
Imagine profil
Abandonează
sneha antony
Autor

where to write this coding?Isnt there any change in .py file?

Jagdish Panchal

Add this code in .xml file

sneha antony
Autor

should I replace the present code for student tree view or else paste as another code?

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
how to add a button in a one2many tree view Rezolvat
treeview one2many
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
dec. 23
18665
Display One2many field value in tree view (Odoo 9)
treeview one2many
Imagine profil
Imagine profil
1
sept. 16
8108
editable treeview without ability to add new items
treeview one2many
Imagine profil
0
mar. 15
4412
How to display related fields of one2many field in list view?
treeview one2many relations
Imagine profil
0
sept. 24
296
one2many field show possible unexisting records in view
treeview one2many virtual-record
Imagine profil
Imagine profil
1
mar. 23
2958
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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