Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
7132 Visninger

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
Kassér
Forfatter

​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


Bedste svar

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
Kassér

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

Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
3
nov. 23
3612
1
sep. 23
1867
1
apr. 24
3322
1
jan. 24
1880
1
dec. 22
2729