تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1257 أدوات العرض

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
مايو 15
4473
1
يونيو 21
4541
1
نوفمبر 16
3525
0
مارس 16
6208
1
أكتوبر 15
4546