'Test access to records having restricted fields'

@mute_logger('odoo.models')
def test_fields_browse_restriction(self):

    partner = self.env['res.partner'].sudo(self.demo_user)
    self._set_field_groups(partner, 'email', GROUP_SYSTEM)
    partner = partner.search([], limit=1)
    partner.name
    with self.assertRaises(AccessError):
        with mute_logger('odoo.models'):
            partner.email
