跳至內容
選單
此問題已被標幟
1 回覆
30559 瀏覽次數

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

頭像
捨棄
最佳答案

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. 

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
3月 15
4243
9
3月 20
42070
0
9月 19
98
2
10月 18
3986
6
1月 18
32672