Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
31330 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

test=[]

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

try this

Ảnh đại diện
Huỷ bỏ

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

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

but the result is none

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 24
1339
1
thg 10 20
9470
0
thg 3 15
5688
0
thg 3 15
6757
1
thg 8 25
427