Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

how to add a tree view in openerp 7?

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
treeviewone2manyobject
1 Répondre
9706 Vues
Avatar
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
Avatar
Ignorer
Avatar
Jagdish Panchal
Meilleure réponse

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
Avatar
Ignorer
sneha antony
Auteur

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

Jagdish Panchal

Add this code in .xml file

sneha antony
Auteur

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

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
how to add a button in a one2many tree view Résolu
treeview one2many
Avatar
Avatar
Avatar
Avatar
Avatar
4
déc. 23
18680
Display One2many field value in tree view (Odoo 9)
treeview one2many
Avatar
Avatar
1
sept. 16
8136
editable treeview without ability to add new items
treeview one2many
Avatar
0
mars 15
4441
How to display related fields of one2many field in list view?
treeview one2many relations
Avatar
0
sept. 24
296
one2many field show possible unexisting records in view
treeview one2many virtual-record
Avatar
Avatar
1
mars 23
2976
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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