تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6005 أدوات العرض

 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
يناير 22
28933
1
يونيو 18
15429
1
مارس 18
4161
0
مارس 18
2603
2
أكتوبر 17
8482