Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6003 มุมมอง

 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

Related Posts ตอบกลับ มุมมอง กิจกรรม
Domain in Many2many Field แก้ไขแล้ว
1
ม.ค. 22
28932
1
มิ.ย. 18
15429
1
มี.ค. 18
4161
0
มี.ค. 18
2601
2
ต.ค. 17
8477