Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1276 Zobrazení

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!


Avatar
Zrušit
Autor Nejlepší odpověď

.

Avatar
Zrušit
Nejlepší odpověď

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



Avatar
Zrušit
Autor

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.

Related Posts Odpovědi Zobrazení Aktivita
0
kvě 15
4479
1
čvn 21
4557
1
lis 16
3531
0
bře 16
6211
1
říj 15
4549