Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
7240 Widoki

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!


Awatar
Odrzuć
Autor Najlepsza odpowiedź

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!

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

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.