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

Hi

I am working with Odoo enterprise web 16.4+e

I have Position table that taking positions from Employee table and showing the total of each position but currently if there are 2 same positions it will show it one by one. What I want is merging same position name and sum the total for that position as depicted below.

Is it possible to do this?

Any help will be appreciated. Thanks!


아바타
취소
작성자 베스트 답변

.

아바타
취소
베스트 답변

Hello,

If you need sum the total for that position only try to get it from "hr.job" model

or

new_dict={}
employee = search the employees based on your condition
for employee in employees:
​if employee.position not in new_dict.keys(): #confirm whether the position exists
​new_dict.update({employee.position:1})
​else:
​​new_dict[employee.position]+=1



아바타
취소
작성자

Hi Sreeraj, thank you so much for your answer but I didn't get the "dictionary" you mentioned. Can you please elaborate more or give some example? Cheers.

관련 게시물 답글 화면 활동
0
5월 15
4507
1
6월 21
4600
1
11월 16
3547
0
3월 16
6236
1
10월 15
4564