does not show the hierarchy in the form

Asked by minotavr_x86 on 2012-06-29

<record id="view_department_tree" model="ir.ui.view">
 <field name="model">depart.list</field>
 <field name="type">tree</field>
 <field name="field_parent">child_ids</field>
 <field name="arch" type="xml">
 <tree string="department">
 <field name="name" select="1"/>
 <field name="parent_id"/>
 </tree>
 </field>
</record>

<!--============ФОРМА==========================-->
<record id="view_department_form" model="ir.ui.view">
 <field name="name">department.form</field>
 <field name="model">depart.list</field>
 <field name="type">form</field>
 <field name="arch" type="xml">
 <form string="department">
 <group col="2" colspan="2">
 <field name="name" select="1"/>
 <field name="parent_id"/>
 </group>
 </form>
 </field>
</record>

 <!--============ACTION==========================-->
<record id="open_module_tree_department" model="ir.actions.act_window">
 <field name="name">Подразделения</field>
 <field name="res_model">depart.list</field>
 <field name="view_type">tree</field>
 <field name="view_mode">tree,form</field>
</record>
In the form displays a table

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo GTK Client (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
2012-06-29
Last reply:
2013-02-10

This question was originally filed as bug #1019174.

minotavr_x86 (minotavr-x86) said : #1

<record id="view_department_tree" model="ir.ui.view">
 <field name="model">depart.list</field>
 <field name="type">tree</field>
 <field name="field_parent">child_ids</field>
 <field name="arch" type="xml">
 <tree string="department">
 <field name="name" select="1"/>
 <field name="parent_id"/>
 </tree>
 </field>
</record>

<!--============ФОРМА==========================-->
<record id="view_department_form" model="ir.ui.view">
 <field name="name">department.form</field>
 <field name="model">depart.list</field>
 <field name="type">form</field>
 <field name="arch" type="xml">
 <form string="department">
 <group col="2" colspan="2">
 <field name="name" select="1"/>
 <field name="parent_id"/>
 </group>
 </form>
 </field>
</record>

 <!--============ACTION==========================-->
<record id="open_module_tree_department" model="ir.actions.act_window">
 <field name="name">Подразделения</field>
 <field name="res_model">depart.list</field>
 <field name="view_type">tree</field>
 <field name="view_mode">tree,form</field>
</record>
In the form displays a table

Minovtar,

<field name="view_type">tree</field> will always display the hierarchy view, never a form view.

There are varios examples available.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask minotavr_x86 for more information if necessary.

To post a message you must log in.