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

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

形象
丢弃
相关帖文 回复 查看 活动
1
6月 23
2395
1
2月 23
2094
1
4月 25
1084
2
8月 24
3299
2
1月 24
1269