跳至内容
菜单
此问题已终结

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? 


形象
丢弃
相关帖文 回复 查看 活动
0
4月 25
816
1
8月 23
1146
0
2月 25
815