跳至内容
菜单
此问题已终结
2 回复
7435 查看

Hello,

I created a one2many tree view in the form view. After click on "add a line" in one2many tree view. It will open a form view of a model connected by many2one.

Cause I want to select directly the value from the tree/list view which has already the values.

So how to open the tree/list view of the model connected by many2one via "add a line" in one2many tree view?

Please help!

Thank you!


形象
丢弃
编写者 最佳答案

I'd solved my wish.

Just add the widget='many2many' after one2many field.

And it will load the list view for selecting the value.

Thank you!

形象
丢弃
最佳答案

Hi,

Seems you need to enter the values directly in the one2many tree view, rather than entering in the one2many form. For this what you have to do is that, set editable="bottom" along with the one2many tree definition.

Sample:

<field name="state_ids">
<tree editable="bottom">
<field name="name"/>
<field name="code"/>
</tree>
</field>

Reference: One2many Field - Editable Bottom and Top


Thanks

形象
丢弃
编写者

Hi Niyas, thank you for your support. That's useful information.

But not in my wish. I mean I have a list view that already has a value. Now I want to load that list view for selecting directly the value via button: 'add a line', not enter directly the value into the one2many field.