Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How models works in OpenERP???

Sarath Chandran.C
on 6/8/13, 3:22 PM 838 views

Hi I am new to OpenERP... Iam confused how a module works. I got a sample module code from google. The code is as follows:

student.py:(Python module file)

from osv import osv,fields
class student_info(osv.osv):
_name = 'student.info'
_columns = {
    'name' : fields.char('Name', size=20, required=True),
    'phNo' : fields.integer('Ph No:', required=True)

XML File:

    <!-- Tree View Operation Starts -->
        <record id="student_info_tree" model="ir.ui.view">
            <field name="name">student.result.tree</field>
            <field name="model">student.info</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="student_result">
                    <field name="name" />
                    <field name="phNo" />
    <!-- Tree View Operation Ends -->

    <!-- Form View Operation Starts -->
        <record id="student_info_form" model="ir.ui.view">
            <field name="name">student.result.form</field>
            <field name="model">student.info</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="General Information">
                    <field name="name"/>
                    <field name="phNo"/>
    <!-- Form View Operation Ends -->

    <!-- Action Operation Starts -->
        <record id="action_student_info_form" model="ir.actions.act_window">
            <field name="name">General Information</field>
            <field name="res_model">student.info</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
    <!-- Action Operation Ends -->

    <!-- Menu Operation Starts -->
        <menuitem id="student_parent" name="student" icon="terp-partner"/>
        <menuitem id="menu_student_parent" name="General Information Management" parent="student_parent"></menuitem>
        <menuitem action="action_student_info_form" id="menu_student_info" parent="menu_student_parent" string="Result"/>
    <!-- Menu Operation Ends -->

When I run this code its working fine. Insert and List operations are working fine. In this code their is no select nor insert query but both operations are taking place. Can any one help me to understand how this works??? Thanks in advance for your valuable answers...



--Borni DHIFI--
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 


Skype : dhifi.borni

On 6/8/13, 3:35 PM


the OpenObject framwork of openerp make all the operations.

you can start in OpenERP with How i can create module openerp 7 ?

Thanks alot for your help Borni:)

Sarath Chandran.C
on 6/8/13, 3:48 PM

Can you mark your question as solved, and mark the correct answer

on 6/9/13, 7:57 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 6/8/13, 3:22 PM
Seen: 838 times
Last updated: 3/16/15, 8:10 AM