Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
6559 Переглядів

Let's start with a basic One2many relation, a class Parent and a class Child.

When I open a Parent form and try to create a new Child from the one2many popup opend by the "child_ids" form field, the parent_id field is not selected with the current open Parent from the window view ! I have to retrieve it in the parent_id selection field to re-select it.

Is there a way to do this autoselection ?


(http://stackoverflow.com/questions/30027934/pre-select-parent-item-in-many2one-popup)

Аватар
Відмінити
Найкраща відповідь

Hello SITER,


For autoselect the parent_id you have to pass parent_id in context like this,


<field name="child_ids" context="{'default_parent_id': active_id}"/>


Here active_id = current id of parent object.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
квіт. 15
5271
2
квіт. 15
4722
1
вер. 20
3366
0
черв. 18
3711
0
бер. 15
6022