does not show the hierarchy in the form

Asked by minotavr_x86

<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:
Last reply:

This question was originally filed as bug #1019174.

Revision history for this message
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

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#2

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.