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.
for count records matching a domain you should use function "search_count", quote from documentation:
search_count(args) → int
Returns the number of records in the current model matching the provided domain.
in your case, it'll be something like,
in v8 style:
count = self.env['model.name.to.search.in'].search_count([('state','=','in')])
in v7 style:
count = self.pool['model.name.to.search.in'].search_count(cr,uid, [('state', '=', 'in')], context=context)
then in "count" variable you'll have the desired number. adapt it to your case.
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: 8/24/15, 5:41 AM|
|Seen: 1923 times|
|Last updated: 8/24/15, 10:55 AM|