A Diumenge 10 Agost 2008, [EMAIL PROTECTED] va escriure:
> Hi,
>
> I am writing a new module that only contains a wizard. The module is
> supposed to write an xml file with some of the data that exists in the
> database. Is a wizard the best way to do this?
>
> To write the xml I need to retrieve, for example. all partners. I am using
> the browse method. If I want to retrieve only the partners with id 1 and 2
> I would do this:
>
> partners =
> pooler.get_pool(cr.dbname).get('res.partner').browse(cr
>, uid, [1,2])
>
> but if I want all the partners? What should I use to substitute the ids
> [1,2]?
you need to search all partner ids first. Something like:
ids = pooler.get_pool(cr.dbname).get('res.partner').search(cr, uid, [])
Really think OpenERP/Objects should provide a means to read/browse without the
need of doing 'search()' first. Otherwise we're doing two sequential scans on
the table and it's highly inefficient. Any plans on this?
--
Albert Cervera i Areny
http://www.NaN-tic.com
_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users