Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
7961 Переглядів

Hello ,

please i want to add a Tree view inside notebook form view in odoo 10 custom module, like the standards odoo modules

how can i do it ? 

Аватар
Відмінити
Найкраща відповідь

Hi ,

In python file you should need to set the field as a One2many field


Ex: x = fields.One2many('relationship_class', 'x_field', string='X')


In you XML file you should need to indicate the filed as tree view


Under the tree tag you should need to mention the fields that you need to view from the related object


Ex : 


<notebook string="X_title">

    <page string="X_title">

        <field name="x">

            <tree editable="bottom">

                <field name="x1_field"/>

                <field name="x2_field"/>

            </tree>

        </field>

    </page>

</notebook>

Аватар
Відмінити
Найкраща відповідь

Ok, You have two model, A and B. Now create a one2many field in your model A with model B. In other words make a one2many relation between model A and B. Now if you display that one2many field in your model A (form view inside notebook), it will display like a tree view.

 

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лип. 21
2879
1
лист. 17
20324
0
трав. 17
3624
1
вер. 23
4724
0
серп. 22
2323