> We can rewrite the query with the search method and with this way, avoid the 
> sql query and the code is readable.
> Example:
> 
>       journal_obj = self.pool.get('account.journal')
>       journal_ids = journal_obj.search(cr, uid,
>                                       [('auto_cash', '=', True),
>                                        ('type', '=', 'cash'),
>                                        ('id', 'in', j_ids)])
> 
>       for journal in journal_obj(cr, uid, journal_ids):
>               # do something

Forgot the 'browse' method.

Stéphane
-- 
Stephane Wirtel - "As OpenERP is OpenSource, please feel free to contribute."
Quality/Release Manager
Technical Project Manager
OpenERP S.A.
Chaussee de Namur, 40
B-1367 Grand-Rosière
Tel: +32.81.81.37.00
Web: http://www.openerp.com
Planet: http://www.openerp.com/planet/
Blog: http://stephane-wirtel-at-tiny.blogspot.com

<<attachment: stw.vcf>>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to