Skip to Content
Menu
This question has been flagged
1 Reply
5370 Views

 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
Discard
Best Answer

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

Avatar
Discard
Author

@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

Related Posts Replies Views Activity
1
Jan 22
26630
1
Jun 18
13694
1
Mar 18
3349
0
Mar 18
1706
2
Oct 17
7404