If you just want to view a list of all the pets, I recommend a wizard (osv.osv_memory).
Anyway, wizard or not:
Add a default value for your many2many field and use a function to get all pets.
_columns = {
'pet_ids' = fields.many2many(.....),
}
def _get_default_pet_ids(self, cr, uid, context=None):
return self.pool.get('your_pet_module').search(cr, uid, [])
_defaults = {
'pet_ids' = _get_default_pet_ids,
}
That's it.
EDIT:
The standard way to filter your data is using a search view.
But if you want to use a selection field do something like this:
def onchange_onwer_id(self, cr, uid, ids, val):
ids = self.pool.get('your_pet_module').search(cr, uid, [('owner_id','=',val)])
return {'value' : {'pet_ids' : ids}}
_columns = {
'pet_ids' = fields.many2many(.....),
'owner_id' = fields.many2one(.......),
}
and in your .xml:
<field name="owner_id" on_change="onchange_owner_id(owner_id)"/>