I want to change M2O field domain based on the user selection from selection field:

```
  @api.onchange('search_by')
  def _get_partner(self):
        partners  = self.env['customer.regist'].search([('name','!=','New')])
        partner_list = []
        partner_list2 = []
        for rec in partners:
            partner_list.append(rec.name)
            partner_list2.append(rec.phone)
        res = {}
        if self.search_by == 'code':
            res['domain'] = {'search_value': [('name', 'in', partner_list)]}
        if self.search_by == 'phone':
            res['domain'] = {'search_value': [('phone', 'in', partner_list2)]}
        return res

```

but the domain not change and get the default domain from model