跳至內容
選單
此問題已被標幟
1 回覆
6013 瀏覽次數

 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
28947
1
6月 18
15435
1
3月 18
4165
0
3月 18
2608
2
10月 17
8499