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

Dears:

my env is odoo V8 

i have many2many fields.. 

orders_id = fields.Many2many('mrp.production', relation='mrp_rel_mo')
order_list = self.env.cr.execute('select mrp_production_id from mrp_rel_mo where mrp_rel_mo_id = %s', (self.id))
data = {
     "order_list" = self.env.cr.fetchall()
}

but can't get order_list data....allways is None ....


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please check table in pg admin and ensure the data is available. then try to execute the same query on the psql pan, this would helps to clear your doubts.

Update dict 'data' as

data = {

     "order_list" : order_list.fetchall()

}


Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

test=[]

self._cr.execute('select selecting filed from table name )
test.append(self._cr.fetchone())

try this

อวตาร
ละทิ้ง

temp_value= self._cr.execute('select * from std_table_print')

data={ "temp_value":temp_value.fetchall() }

but the result is none

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 24
1352
Connecting 2 Many2many Fields แก้ไขแล้ว
1
ต.ค. 20
9498
0
มี.ค. 15
5701
0
มี.ค. 15
6783
0
ส.ค. 25
129