<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'/> </tree> </field> </page>
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.
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.
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"/> </tree> </field> </record>
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 :
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
|Asked: 4/19/14, 4:06 PM|
|Seen: 1321 times|
|Last updated: 3/16/15, 8:10 AM|