Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
The Documentation states that the various methods of the class openerp.osv.orm.BaseModel like browse, search, write, etc. can receive and return a single id/record.
Example: return value for browse method:
Return type: object or list of objects requested
Or select argument for browse method:
select -- id or list of ids.
Or return value for search method:
Returns: id or list of ids of records matching the criteria
I often have the feeling that this is not true and all methods allways expect and return lists.
Is my feeling wrong?
EDIT (in lack of comment functionality):
Thx, Mr. Reis. You are quite right! But is it also true for search?
Search always returns a list. The documentation is wrong. (Although the technical memento states it correctly).
Yes, it is right that most of the ORM methods accepts list of IDs and some of them returns list of IDs or single ID.
Search methods returns list of IDs, write, unlink returns True and create returns new ID.
You can see all the methods here: http://bazaar.launchpad.net/~openerp/openobject-server/7.0/view/head:/openerp/osv/orm.py
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/21/14, 4:46 AM|
|Seen: 12746 times|
|Last updated: 6/7/15, 2:35 AM|