콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5993 화면

 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...

아바타
취소
베스트 답변

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

아바타
취소
작성자

@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

관련 게시물 답글 화면 활동
1
1월 22
28915
1
6월 18
15421
1
3월 18
4160
0
3월 18
2595
2
10월 17
8467