2
votes

I want to add a selection field to the form view and show the selection in tree view.

I first tried adding a custom selection field to the model but since I have many values to add to the selection field I bumped to the char(128) limit of the selection field of ir.model model.

Second I created a new custom model named x_newmodel with 3 fiedls with names x_name, x_code, x_description added a one2many field x_newfield connecting to the x_newmodel solved the problem with the form view.
However when I try to add the new field x_newfield to the tree view I cannot get to show the data on the view.

My question is how can I add the field one2many relationship of the custom field to the tree view?

1

1 Answers

3
votes

AFAIK, it is not supported.

What you could do is add a function field on your model which would compute

','.join(elem.name for elem in obj.x_newfield) 

and use this in your tree display.

If you need to add a filter, you can implement the search function for your function field.