'search_count(args) -> int
Returns the number of records in the current model matching :ref:`the
provided domain <reference/orm/domains>`.'

@api.model
def search_count(self, args):

    res = self.search(args, count=True)
    return (res if isinstance(res, (int, long)) else len(res))
