title: Hide field odoo in python onchange method
body: <p>I have a small question, just to research.
  I can hide a field based on attrs in odoo 8, but is there a way to do the same in python code. below is the code:</p>
  
  <pre><code>&lt;field name="test" attrs="{'invisible':[('role', '=', 'testrole')]}" /&gt;
  </code></pre>
  
  <p>so this does the work ( means hides the field if field name role has value 'test role' )
  Then i tried to achieve same functionality using python with method onchange on role field as below:</p>
  
  <pre><code>&lt;field name="role" on_change="hide(role)"/&gt;
  </code></pre>
  
  <p>in my model :</p>
  
  <pre><code>def hide(self,cr,uid,ids,role) :
      res = {'value':{}}
      if role == 'testrole':
         res['value']['test']['attrs']['invisible']=True
      return res
  </code></pre>
  
  <p>But this does not work, 
  Any suggestions ?</p>
  
  <p>Thanks,</p>