Skip to Content
Menu
This question has been flagged

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>


Avatar
Discard
Author

​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


Best Answer

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.

Avatar
Discard

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

Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
3
Nov 23
2837
1
Sep 23
1192
1
Apr 24
2461
1
Jan 24
1124
1
Dec 22
2185