-1

I want to iterate account.invoice in my custom module. I am using following line for the iteration but it is not working properly.

for filex in self.env['account.invoice'].search_read([],['partner_id','status','date_due']):

Zeeshan Anjum
  • 450
  • 5
  • 21

1 Answers1

1

search_read returns a dict (check this), thus you need to iterate like this:

for (key, value) in self.env['account.invoice'].search_read([],['partner_id','status','date_due']).iteritems():
Alessandro Ruffolo
  • 1,575
  • 1
  • 16
  • 34