콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
4490 화면

Hello,

We are passing "group_by_no_leaf" in context of action, can anyone help me to understand exact use of that?

For example, as given below :

<record id="action_project_task_user_tree" model="ir.actions.act_window">
<field name="name">Tasks Analysis</field>
<field name="res_model">report.project.task.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,pivot</field>
<field name="search_view_id" ref="view_task_project_user_search"/>
<field name="context">{'group_by_no_leaf':1,'group_by':[]}</field>
<field name="help">This report allows you to analyse the performance of your projects and users. You can analyse the quantities of tasks, the hours spent compared to the planned hours, the average number of days to open or close a task, etc.</field>
</record>


아바타
취소
베스트 답변

Hi,

"group_by_no_leaf" is an optional parameter for list views that hides the top row of buttons when given. (The row containing the 'Create', 'Import', etc. buttons).

아바타
취소
베스트 답변

Here's a practical example:

Suppose you have a list of tasks related to various projects and users. You want to create a pivot view that shows the total number of tasks grouped by projects and users. If you set group_by_no_leaf to 1, you will only see the projects and users as groups without displaying the individual tasks. This can be useful when you're interested in high-level summaries and don't need to see each task's details.


'context': {'group_by_no_leaf': 1, 'group_by': []}


  • 'group_by_no_leaf': 1 indicates that you want to group without displaying individual leaf records.
  • 'group_by': [] means that no specific grouping fields are defined, so it will use the default grouping fields (if any) defined in the view.

The exact behavior and effect of group_by_no_leaf will depend on the specific view type (e.g., list, pivot, graph) and the configuration of your view. It allows you to control whether detailed records are shown when grouping records in a view.

아바타
취소
베스트 답변

Hello Mital Vaghani,

I hope you are doing well.

You can try this code 
Please find code in comment. 

I hope this will help you.

Thanks & Regards,
Email:    odoo@aktivsoftware.com   

Skype: kalpeshmaheshwari

아바타
취소

Please find code here :-

<record id="action_project_task_user_tree" model="ir.actions.act_window">
<field name="name">Tasks Analysis</field>
<field name="res_model">report.project.task.user</field>
<field name="view_mode">graph,pivot</field>
<field name="search_view_id" ref="view_task_project_user_search"/>
<field name="context">{'group_by_no_leaf':1, 'group_by':[], 'graph_measure': '__count__'}</field>
<field name="help">This report allows you to analyse the performance of your projects and users. You can analyse the quantities of tasks, the hours spent compared to the planned hours, the average number of days to open or close a task, etc.</field>
</record>

관련 게시물 답글 화면 활동
3
11월 23
17807
3
11월 24
25638
1
4월 23
6389
3
4월 23
9556
2
12월 22
7219