Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
7103 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
พ.ย. 23
3597
1
ก.ย. 23
1862
1
เม.ย. 24
3310
Filter One2many field in res.partner แก้ไขแล้ว
1
ม.ค. 24
1864
1
ธ.ค. 22
2729