Skip to Content
Menu
This question has been flagged
1 Atsakyti
30522 Rodiniai

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

Portretas
Atmesti
Best Answer

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. 

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
kov. 15
4224
9
kov. 20
42038
0
rugs. 19
98
2
spal. 18
3953
6
saus. 18
32611