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

I have two models: Project and Task

Project has a view with the field task_ids (One2many with Task). Inside the views file for Task there are two tree views and two form views. These are shown based on the group the user has.

Now when I click on 'Add a new line' in Project to add a Task, it shows the first tree found in the Task views file. How can I choose which form it has to use when clicking 'Add a new line'?

Thanks in advance! Please let me know if you need more context.

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

Thank you so much Niyas!!!

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

Hi,

Along with your one2many field, if inline views are not specified, you can achieve it as follows:


<field name="event_booth_ids"
context="{
'form_view_ref': 'event_booth.event_booth_view_form_simple_from_event',
'tree_view_ref': 'event_booth.event_booth_view_tree_from_event',
}"
/>


Thanks

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
черв. 23
2680
1
лют. 23
2318
1
квіт. 25
1396
2
серп. 24
4116
2
січ. 24
2013