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 to set fix size of text box in tree view in a line one2many ....please help

Praveen Upadhyaya
on 4/19/14, 4:06 PM 1,321 views
            <page string="Questions">
                        <field name="question_items">
                        <tree string="Questions" color ="blue" editable="bottom">                
                        <field name='que_no'/>
                        <field name='que'  bgcolor="green" fgcolor="yellow" cssclass="text_class"/>
                                <field name='option_a'/>
                                <field name='option_b'/>
                                                    <field name='option_c' />
                        <field name='option_d'/>
                                    <field name='option_e'/>
                                                    <field name='cd_choice'/>  
Praveen Upadhyaya
On 4/20/14, 4:32 AM

I am trying to fetch records from a table(question_bank) and want to display all of them in a tree(list_of_questions) view under a form(student) view.

'question_items':fields.one2many('list_of_questions', 'student_id','Details'),

I can get one field value of a record by browse but I want to fetch all the records exactly from the table and display them in the tree view.

Like: display list of all the employees in a tree view from hr.employee.

please help me ..................I hope you will at least give me some reference from where I can get the the solution of my problem.


Med Said BARA

--Med Said BARA--
| 5 5 7
--Med Said BARA--
Med Said BARA
On 4/19/14, 7:21 PM

Control size of field in view

How to change column width in tree view one2many,many2many

Changing column widths tree view

Data Elements


According to your last comment, here is the example from hr_view.xml tree view:

    <record id="view_employee_tree" model="ir.ui.view">
        <field name="name">hr.employee.tree</field>
        <field name="model">hr.employee</field>
        <field name="arch" type="xml">
            <tree string="Employees">
                <field name="name"/>
                <field name="work_phone"/>
                <field name="work_email"/>
                <field name="company_id" groups="base.group_multi_company"/>
                <field name="department_id"/>
                <field name="job_id"/>
                <field name="parent_id"/>
                <field name="coach_id" invisible="1"/>

To use this example, you have to change:

 id="view_employee_tree"  to  id="view_questions_tree" ,

  hr.employee to question.bank, 

 <tree string="Employees">  to <tree string="Questions">

and inside the tree just add :

           <field name="question_items"/>

Sir please help me ....................I need to fetch multiple record from a class and display in a tree view under a form view

Praveen Upadhyaya
on 4/20/14, 4:31 AM

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

0 follower(s)


Asked: 4/19/14, 4:06 PM
Seen: 1321 times
Last updated: 3/16/15, 8:10 AM