Community mailing list archives

community@mail.odoo.com

Re: New api browse - what for if search returns record set?

by
Camptocamp SA, Yannick Vaucher
- 10/03/2014 07:14:10
When you have ids in hand, you will want to use browse.

Also, you can use self.browse() to create an empty recordset that you could lately populate when filtering.

Regards,


On Thu, Sep 25, 2014 at 8:15 PM, Pedro Manuel Baeza Romero <pedro.baeza@gmail.com> wrote:
You still need browse if you have to get the browse_record for an ID-XML reference or for a result of an SQL query or a lot of other situations...

Regards.

2014-09-25 16:40 GMT+02:00 Jean-Sébastien Suzanne <jssuzanne@anybox.fr>:


2014-09-25 13:56 GMT+02:00 Maxim Litnitskiy <litnimaxster@gmail.com>:
Hi guys!
I have a simple question.
If now (new api)  search method  returns RecordSet why at all we can require browse??
Or I miss anything in concept?
I am doing:

for contact in self.env['res.partner'].search('my_search','=',True):
for contact in self.env['res.partner'].search([('my_search','=',True)]): 
   do contact.field = new_value

Am I right?
yes 

Thanks.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Jean-Sébastien SUZANNE
jssuzanne@anybox.fr
06 51 35 50 50

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Yannick Vaucher
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 30
Office: +41 21 619 10 10