Closed lepistone closed 10 years ago
good catch, and in this case, it's problematic because erppeek does not match the browse method of the ORM.
Empty list is indeed considered as an empty domain.
With usage it become quite natural but it would be nice to simply having browse without any parameter to browse all and empty list will return empty record list. The problem is that altering this behaviour will break a lot of code.
Named parameters can be a solution too.
My two cents
Nicolas
Actually, ERPpeek browse()
was designed as the search_read
method of the json API in v7.
Now it matches the behavior of the search()
method of the new Odoo API.
I'll add some lines from @lepistone in the documentation to insist on this point ...
My own recommendation is to replace all usages of search
with browse
when using ERPpeek. It makes things simpler, and it gives no surprise.
Hi,
the
Model.browse()
method accepts an integer, a list or a domain. I realized that when passing a list, there is the risk that an empty list is considered as an empty domain and finds all records instead of none.This looks just a bit confusing because of the different style between openerp and erppeek: the openerp idiom
should not be translated as is to erppeek because if nothing is found, we get all records.
Instead, in erppeek it could just be written:
IMO this issue can be addressed just with an extra remark in the doc.
Thanks!