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

Hi,

I'd like to know can use a 'browse' like this:

employee_ids = self.pool['hr.employee'].browse(cr, uid, [0])

but with all the records, no the first one [0].

Thanks

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

Hi,

To achieve you goal we have two ways.

1) With New API : all_employees = self.env['hr.employee'].search([])

It will give us all employee list of browse object.

2) with old API : all_employees = self.pool['hr.employee'].browse(cr, uid, self.pool['hr.employee'].search(cr, uid, []) )

It will also give us all employee list of browse object.

I hope it will help you. 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
4228
Expected singleton Đã xử lý
9
thg 3 20
42044
0
thg 9 19
98
2
thg 10 18
3968
6
thg 1 18
32632