title: How to filter column by other column in odoo 12?
body: <p>I try to filter an "item" column that has a many2one type based on the names that already exist in another "itemsnames" column that has a char type, I can not write the domain in the xml file, here is my xml file:</p>
  
  <pre><code>&lt;record id="sale_order_line_form_inherited" model="ir.ui.view"&gt;
              &lt;field name="name"&gt;sale_order.line.form.inherited&lt;/field&gt;
              &lt;field name="model"&gt;sale.order&lt;/field&gt;
              &lt;field name="inherit_id" ref="sale.view_order_form"/&gt;
              &lt;field name="arch" type="xml"&gt;
                  &lt;xpath expr="//tree//field[@name='name']" position="after"&gt;
                      &lt;field name="categorie"/&gt;
                      &lt;!--&lt;field name="item" domain="[('item.name','=', 'name.name')]"/&gt;--&gt;
                      &lt;!--&lt;field name="item" domain="[('item.name','in',items)]"/&gt;--&gt;
                      &lt;field name="item" domain="[('item.name','in',itemsnames)]"/&gt;
                      &lt;field name="itemsids"/&gt;
                      &lt;field name="itemsnames"/&gt;
                  &lt;/xpath&gt;
              &lt;/field&gt;
          &lt;/record&gt;
  </code></pre>
  
  <p>Here is python file:</p>
  
  <pre><code>class class2(models.Model):
      _name = 'module.item'
      name = fields.Char(string='item')
  
  
  class class3(models.Model):
      _name = 'module.categorieitem'
      name = fields.Many2one('module.categorie', string='Categorie')
      item = fields.Many2one('module.item', string='Item')
  
  
  class class4(models.Model):
      _inherit = 'sale.order.line'
      categorie = fields.Many2one('module.categorie')
  
      # list1=[1,2]
      # item = fields.Many2one('module.item', domain=[('id', '=', list1)])
      item = fields.Many2one('module.item')
      itemsids = fields.Char()
      itemsnames = fields.Char()
  
      @api.onchange('categorie')
      def _onchange_categorie(self):
          print('»»» call onchange_categorie')
          res = {}
          items_ids = []
          items_names = []
          records = self.env['module.categorieitem'].search([('name','=',self.categorie .id)])
          for record in records:
              print(record.item.name)
              items_ids.append(record.item.id)
              items_names.append(record.item.name)
          self.itemsids = items_ids
          self.itemsnames = items_names
          print('itemsnames: ',self.itemsnames)
          res['domain'] = {'item':[('id','in',items_ids)]}
          return res
  </code></pre>
  
  <p>Here is screenshot for view</p>
  
  <p><img src="https://i.stack.imgur.com/Yle4V.png" alt="view"></p>