Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
923 มุมมอง

We are a language school and extensively use the Events application.  We just upgraded to Odoo 17 and lost the count of unconfirmed registrations at the Event level.  This is a major step back for us.  We now do not have this insight across all our events. 


To solve this I am trying to create a computed field in the Event model which calculates the total number of unconfirmed registrations per event.  

I have tried various approaches including the one below but only get zero values in the field. 


Model: event

Field Type: integer

Dependencies:registration_ids 


Code:

for record in self:

    record['x_event_unconfirmed_reg_count'] = len(record.registration_ids.filtered(lambda r: r.state == 'Unconfirmed'))


What is wrong? 


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 25
816
1
ส.ค. 23
1145
0
ก.พ. 25
815