Odoo Help

Welcome!

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.

0

difference between tree view and list view

By
Peter Nietz
on 3/18/14, 1:41 PM 4,164 views

hi

I tried to write a new list view, but instead I get a tree view. The search field is missing and I cannot sort the columns by clicking on them:

<!-- New Tree View -->
<record model="ir.ui.view" id="view_my_tree">
  <field name="name">my_module.marker.tree</field>
  <field name="model">my_module.marker</field>
  <field name="tag">marker.listView</field>
  <field name="arch" type="xml">
    <tree string="Stages">
      <field name="lat"/>
      <field name="lon"/>
      <field name="user_id" widget="many2one_tags"/>
    </tree>
  </field>
</record>

[...]

<!-- Action -->
<record model="ir.actions.act_window" id="action_my_list">
  <field name="name">My List View</field>
  <field name="res_model">my_module.marker</field>
  <field name="view_type">tree</field>
  <field name="view_mode">tree</field>
  <field name="help" type="html">
      <p> map list test
      </p>
    </field>
</record>

<menuitem name="my list" id="menu_app_list" sequence="20" action="my_module.action_my_list"/>

What am I missing? What is necessary to make a list view out of this tree view so the basic table operations work and the search field is visible?

In Openerp List view data are display using the "tree" type tag. There is no difference between tree and list view both are same. In Openerp technically we say list view as tree view.

Prakash
on 3/20/14, 10:29 AM

To show both form and tree view to add in the action the below code suggested Rene Schuster <field name="view_type">form</field> <field name="view_mode">tree,form</field>

Prakash
on 3/20/14, 10:35 AM

There is a difference between tree and list. If view_type tree is used in the act_window it will be a tree view, but form will use a list view. Not very intuitiv. The tree view has no search field and uses no table sorting, the css is also a bit different. A list view has the search field and sorting. The <search> is used to add custom filter to the search, from what I learned yesterday.

Peter Nietz
on 3/21/14, 5:11 AM

Thx, Peter, for the additional information. (=

René Schuster
on 3/21/14, 6:05 AM
2

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 3/20/14, 10:27 AM

List Views and Tree Views are synonymous, as far as I can say.

What might help: Change the view_mode of your action to form:

<field name="view_mode">form</field>

Regards.

that's it ... thx

Peter Nietz
on 3/21/14, 5:28 AM
0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 3/20/14, 10:24 AM

For Search Field to shows in openerp to add the below code in xml file

<record model="ir.ui.view" id="view_my_search">
  <field name="name">my_module.marker.search</field>
  <field name="model">my_module.marker</field>
   <field name="type">search</field>
  <field name="arch" type="xml">
    <search string="Stages">
      <field name="lat"/>
      <field name="lon"/>
      <field name="user_id" widget="many2one_tags"/>
   </search>
  </field>
</record>

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)

Stats

Asked: 3/18/14, 1:41 PM
Seen: 4164 times
Last updated: 3/16/15, 8:10 AM