Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6017 Visualizzazioni

 i have age field in my student.student module,this is computed filed according to birthdate field 

but while searching in odoo its not showing because its computed field so i write below code for eneble searching for this field but its not working 

def _search_subscription(self, operator,value):

        a=[]

        b = self.env['student.student']

        for x in b.search([]):

            if x.age==value:

                a.append(x[0])

        return [('id', 'like' ,a)]


i want to return all field which age is like value,please give me solution...

Avatar
Abbandona
Risposta migliore

just give the store=True attribute for age compute field, and you can search

Avatar
Abbandona
Autore

@Hilar AK ,i know i can do by stored but, i want to do by function that's why i post,but now i got solution

Post correlati Risposte Visualizzazioni Attività
1
gen 22
28952
1
giu 18
15443
1
mar 18
4165
0
mar 18
2612
2
ott 17
8505