Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
30427 Visninger

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

Avatar
Kassér
Bedste svar

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. 

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
mar. 15
4148
9
mar. 20
41985
0
sep. 19
98
2
okt. 18
3908
6
jan. 18
32498