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

ex: show one2many form view, not tree view

<field name="job_data_ids">

<form>

​<group>

<field name="workflow_id"/>

<field name="job_id"/>

<field name="stage_id"/>

<field name="job_properties"/>

group>

form>

field>


아바타
취소
작성자

​i mean show one2many field.
as usual it will display the records on the main form as a tree, can i display the records as a form.
Sorry for the inconvenience, I don't have enough points to reply to comments


베스트 답변

To display a One2Many field as a list of form views instead of a tree view in a form view, you can use the `widget="many2many_tags"` attribute. Here's an example of how you can achieve this:

```xml
















```

In the above code, replace `'your_one2many_field'` with the actual name of your One2Many field. Inside the `

` tag, you can specify the fields you want to display in the form view for each record of the One2Many field.


By using the `widget="many2many_tags"`, the One2Many field will be displayed as a list of form views, where each record can be expanded and edited individually.


Note that the `widget="many2many_tags"` attribute is typically used for Many2Many fields, but it can also be applied to One2Many fields to achieve the desired form view display.

아바타
취소

hi,
thanks for the new info, it seems the code is missing due to issue in code formatting, can you add the code part here in the comment section

베스트 답변

Hi,

This is not possible, if you need like a form view, you can just remove the one2many field and add those field workflow_id, job_id etc directly into your main model and display it inside a notebook page.

If your flow need the one2many field itself, create a computed field in the main model which computes the value from the o2m lines and display those computed fields in the form view,

Thanks

아바타
취소
관련 게시물 답글 화면 활동
3
11월 23
3605
1
9월 23
1866
1
4월 24
3322
1
1월 24
1877
1
12월 22
2729