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.
You can fetch all IDs of particular object by passing blank list  in
For example you can fetch all the IDs of the
purchase.order like this:
purchase_order_ids = self.pool.get('purchase.order').search(cr, uid, , context=context)
In background it will be executed like this:
select id from purchase_order
There are two methods which can be called when you click on save button
create: when you create new record.
write: when you update existing record.
You can overwrite
write methods and inside it you can search for IDs.
Create is called when you create the records:
def create(cr, uid, vals, context=None): #Todo code my_search_ids = self.pool.get('object.name').search(cr, uid, , context=context) #Todo code return super(your_class_name, self).create(cr, uid, vals, context=context)
Write is called when you update the records:
def write(cr, uid, ids, vals, context=None): #Todo code my_search_ids = self.pool.get('object.name').search(cr, uid, , context=context) #Todo code return super(your_class_name, self).write(cr, uid, ids, vals, context=context)
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: 4/15/13, 11:10 AM|
|Seen: 2738 times|
|Last updated: 3/16/15, 8:10 AM|