title: OpenERP field attributes - invisible attribute in tree view
body: <p>Considering the following objects and a corresponding view:</p>
  
  <pre><code>class first_object(osv.osv):
      _name = "first.object"
      _columns = {
                  'id': fields.integer ('First ID'),
                  'flag': fields.boolean ('Flag'),
                  'second_object_id': fields.one2many('second.object','first_object_id')
      }
  
  class second_object(osv.osv):
      _name = "second.object"
      _columns = {
                  'id': fields.integer ('Second ID'),
                  'first_object_id': fields.many2one('first.object','random field'),
                  'field_x': fields.float('x',size=128),
                  'field_y': fields.float('y',size=128),
      }
  
  &lt;record model="ir.ui.view" id="first_object_view_id"&gt;
      &lt;field name="name"&gt;Frist Object&lt;/field&gt;
      &lt;field name="model"&gt;first.object&lt;/field&gt;
      &lt;field name="type"&gt;form&lt;/field&gt;
      &lt;field name="arch" type="xml"&gt;
          &lt;form&gt;
              &lt;notebook&gt;
                  &lt;page&gt;
                      &lt;field name="id"&gt;&lt;/field&gt;
                      &lt;field name="flag"&gt;&lt;/field&gt;
                      &lt;field name="second_object_id"&gt;
                          &lt;tree editable="top"&gt;
                              &lt;field name="field_x" attrs="{'invisible':[('flag','=',True)]}"/&gt;
                              &lt;field name="field_y"/&gt;
                          &lt;/tree&gt;
                          &lt;form&gt;
                              &lt;field name="field_x"/&gt;
                              &lt;field name="field_y"/&gt;
                          &lt;/form&gt;
                      &lt;/field&gt;
                  &lt;/page&gt;
              &lt;/notebook&gt;
          &lt;/form&gt;
      &lt;/field&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p>Notice the attrs I have now for the field of the <em>second object</em> named <strong>field_x</strong> in the tree which is based on the field of the <em>first object</em> named <strong>flag</strong>.  </p>
  
  <p>First of all, the attribute in this case is ignored completely. I dont know why it wont work. Second, assuming this can't work and the attributes MUST refer to local fields, the <strong>invisible</strong> attribute does not work for the <strong>tree</strong> view, just the <strong>form</strong> view. However, if you set a simple <strong>invisible="1"</strong> in the tree it would work just fine (I cant rely on that, I need the rule I provide with attributes). Any ideas?  </p>
  
  <p><strong>EDIT:</strong><br>
  The problem seems to be making fields invisible via attributes (and not invisible="1") in the TREE view. It works fine in the form. If this can be done it would solve my problem.  </p>
  
  <p><strong>EDIT 2:</strong><br>
  I tried with separated view definitions and local fields instead of many2one and one2many to no avail. However, I managed to somehow achieve this with <code>invisible="context.get('xxx',True/False)"</code>. The problem is once the condition is matched, it remains invisible even after creating a new record where the condition is not matched. </p>