Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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? 


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
kwi 25
821
1
sie 23
1147
0
lut 25
816