title: Dynamic domain depending on user selection (odoo 8)
body: <h2>What I need:</h2>
  
  <p>I want to make one field for user to select a category of partners. After he made that I want to let him to select a partner from a selected category. How could I achieve that?</p>
  
  <hr>
  
  <h2>What I did:</h2>
  
  <p>I have the fallowing fields:</p>
  
  <pre><code>partner_categories = fields.Many2one('res.partner.category', string="Partners Categories")
  partner_category_name = fields.Char(related='partner_categories.name', string="Choosen category name")
  partner_adress = fields.Many2one('res.partner', string="Partner from selected category")
  </code></pre>
  
  <p>In the xml i have these lines:</p>
  
  <pre><code>&lt;field name="partner_categories"/&gt;
  &lt;field name="partner_category_name"/&gt;
  &lt;field name="partner_adress" domain="[('res.partner.category','=', 'partner_category_name')]" attrs="{'invisible': [('partner_category_name', '=', 'False')]}"/&gt;
  </code></pre>
  
  <p>But that doesn't work. I'm getting error:</p>
  
  <pre><code>ValueError: Invalid field 'res.partner.category' in leaf "&amp;lt;osv.ExtendedLeaf: ('res.partner.category', 'ilike', 'partner_category_name') on res_partner (ctx: )&gt;"
  </code></pre>
  
  <p>Afcourse it is normal because I can't inherit <code>res.partner</code> module so that I could access all its fields, so <code>res.partner.category</code> is unknown field for my module. But how could I achieve what I need?</p>