title: odoo / openERP one2many fields dynamic domain
body: <p>I want to search records of one2many field that depends on another fields.<br>
  here my code,</p>
  
  <p>Parent class:</p>
  
  <pre><code>class SaleOrder(models.Model):
      _inherit = 'sale.order'
  
      customer_product_ids = fields.One2many('product.product',
                             compute='_get_partner_products')
      order_line = fields.One2many('sale.order.line', 'order_id')
  </code></pre>
  
  <p>Child class:</p>
  
  <pre><code>class SaleOrderLine(models.Model):
      _inherit = 'sale.order.line'
  
      order_id = fields.Many2one('sale.order')
      product_id = fields.Many2one('product.product')
  </code></pre>
  
  <p>View</p>
  
  <pre><code> &lt;record id="view_ata_sale_order_form_inherit" model="ir.ui.view"&gt;
          &lt;field name="name"&gt;view.ata.sale.order.form.inherit&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;field name="partner_id" position="after"&gt;
                  &lt;field name="partner_channel_id" invisible="1"/&gt;
                  &lt;field name="customer_product_ids"/&gt;
              &lt;/field&gt;
              &lt;xpath expr="//tree/field[@name='product_id']" position="attributes"&gt;
                  &lt;attribute name="domain"&gt;[('id', 'in', [rec.id for rec in parent.customer_product_ids])]&lt;/attribute&gt;
              &lt;/xpath&gt;
          &lt;/field&gt;
      &lt;/record&gt;
  </code></pre>
  
  <p>By default, a customer can see all the products defined.<br>
  In my case, I need to filter the products depends on customer selected.<br>
  <em>Each customer can have different list products or if they didn't categorize they can see all the products</em>.</p>
  
  <p>I tried the code above but got error:  </p>
  
  <pre><code>Uncaught Error: Expected "]", got "(name)"
  </code></pre>
  
  <p>I guess the error come from this code:  </p>
  
  <pre><code>&lt;attribute name="domain"&gt;[('id', 'in', [rec.id for rec in parent.partner_product_ids])]&lt;/attribute&gt;
  </code></pre>
  
  <p>my question,<br>
  is it possible to do python loop comprehension like the code above (within view)?</p>
  
  <p>Thank you.</p>