Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5990 Weergaven

 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
Annuleer
Beste antwoord

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

Avatar
Annuleer
Auteur

@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

Gerelateerde posts Antwoorden Weergaven Activiteit
1
jan. 22
28915
1
jun. 18
15421
1
mrt. 18
4159
0
mrt. 18
2594
2
okt. 17
8467