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

Hello everybody!!

Please who can give me an answer.

Why when i do this:

services.create(cr,uid,value) (where services = self.pool.get('project.service.line') )

It add the recordset but without displaying it in the @api v8 of odoo

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

The create method of the old API will only return the id of the record. To view the full record you may use:

new_id = services.create(cr, uid, value) # where services = self.pool.get('project.service.line')
record = services.browse(cr, uid, new_id)

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks a lot for the answer. but, it doesnt work :/

Tác giả

new_id = services.create(cr, uid, value) print new_id record = services.browse(cr, uid, new_id) print record return record I got: 57 callim.project.service.line(57,) But it doesnt display anything. please need an answer

Hi Abdelwahed. This is exactly as expected. If you print record you will get project.service.line(57, ). If you need to print a field, you can do print record.field_name.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
2644
1
thg 7 25
1028
1
thg 8 25
1151
0
thg 5 25
1488
2
thg 4 25
3643