from openerp import fields, models

class Session(models.Model):
    _name = 'openacademy.session'
    
    name = fields.Char(required=True)
    start_date = fields.Date()
    duration = fields.Float(digits=(6, 2), help="Duration in days")
    seats = fields.Integer(string="Number of seats")
    instructor_id = fields.Many2one('res.partner', string="instructor")
    course_id = fields.Many2one('openacademy.course',
                                 ondelete='cascade', string="Course", required=True)
    attendee_ids = fields.Many2many('res.partner', string="Attendees")

from openerp import fields, models

class Session(models.Model):
    _name = 'openacademy.session'
    
    name = fields.Char(required=True)
    start_date = fields.Date()
    duration = fields.Float(digits=(6, 2), help="Duration in days")
    seats = fields.Integer(string="Number of seats")
    instructor_id = fields.Many2one('res.partner', string="instructor",
                                    domain=['|', ('instructor', '=', True),
                                    ('category_id.name', 'ilike', "Teacher")])
    course_id = fields.Many2one('openacademy.course',
                                 ondelete='cascade', string="Course", required=True)
    attendee_ids = fields.Many2many('res.partner', string="Attendees")

Add domain or and ilike
[REF] openacademy: Add domain or and ilike

  from openerp import fields, models
  
  class Session(models.Model):
      _name = 'openacademy.session'
      
      name = fields.Char(required=True)
      start_date = fields.Date()
      duration = fields.Float(digits=(6, 2), help="Duration in days")
      seats = fields.Integer(string="Number of seats")
-     instructor_id = fields.Many2one('res.partner', string="instructor")
+     instructor_id = fields.Many2one('res.partner', string="instructor",
+                                     domain=['|', ('instructor', '=', True),
+                                     ('category_id.name', 'ilike', "Teacher")])
      course_id = fields.Many2one('openacademy.course',
                                   ondelete='cascade', string="Course", required=True)
      attendee_ids = fields.Many2many('res.partner', string="Attendees")
  
Add domain or and ilike
## Code Before:
from openerp import fields, models

class Session(models.Model):
    _name = 'openacademy.session'
    
    name = fields.Char(required=True)
    start_date = fields.Date()
    duration = fields.Float(digits=(6, 2), help="Duration in days")
    seats = fields.Integer(string="Number of seats")
    instructor_id = fields.Many2one('res.partner', string="instructor")
    course_id = fields.Many2one('openacademy.course',
                                 ondelete='cascade', string="Course", required=True)
    attendee_ids = fields.Many2many('res.partner', string="Attendees")

## Instruction:
Add domain or and ilike
## Code After:
from openerp import fields, models

class Session(models.Model):
    _name = 'openacademy.session'
    
    name = fields.Char(required=True)
    start_date = fields.Date()
    duration = fields.Float(digits=(6, 2), help="Duration in days")
    seats = fields.Integer(string="Number of seats")
    instructor_id = fields.Many2one('res.partner', string="instructor",
                                    domain=['|', ('instructor', '=', True),
                                    ('category_id.name', 'ilike', "Teacher")])
    course_id = fields.Many2one('openacademy.course',
                                 ondelete='cascade', string="Course", required=True)
    attendee_ids = fields.Many2many('res.partner', string="Attendees")
