Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
932 Переглядів

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
821
1
серп. 23
1147
0
лют. 25
817