콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
7963 화면

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.

 

아바타
취소
관련 게시물 답글 화면 활동
1
7월 21
2886
1
11월 17
20328
0
5월 17
3629
1
9월 23
4725
0
8월 22
2329