title: OpenERP V7 - How to clear a parent field content after On_Change was trigger in widget="one2many_list"
body: <p>I am writing a customize Lab Test module in OpenERP V7. The rough idea was described in <a href="https://stackoverflow.com/questions/37935843/openerp-7-create-auto-log-message-in-log-a-note-field-as-history-log-record/37969084#37969084">OpenERP 7 - Create auto log message in &quot;Log a Note&quot; field as history log record</a>. </p>
  
  <p>How could i achieve the step 2 where any changes in any field of the  one2many_list fields will trigger a function to clear the text in my "Reason For Change"(ROC) field which is the parent field?</p>
  
  <p>Follow would be my example:</p>
  
  <pre class="lang-py prettyprint-override"><code>'note_change': fields.text('Reason For Change',required=True),
  'lab_lines': fields.one2many('test.lab', 'lab_id', 'Lab Lines'),
  'lab_id': fields.many2one('test.lab', 'Parent Lab', ondelete='cascade', select=True), 
  'product_name': fields.char('Product Name', size=64),
  'product_id': fields.many2one('product.product', 'Product'),  
  </code></pre>
  
  <p>The relavant functions in py would be:</p>
  
  <pre class="lang-py prettyprint-override"><code>def onchange_product_id(self, cr, uid, ids, product_id, name, context=None):
      b_flags = False           
      if product_id:
          prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
          res_id = context.get('test', False)
          if res_id:                
              """
              @TO trigger the function to set reason for change as empty                 
              """
              b_flags = True
              self.fnct_trigger_onchange(cr,uid,res_id,b_flags,context)               
          else:
              #other code here         
  
          warning = { 'title': 'Warning!',
                      'message' : 'Please enter reason for changes.',
                    }
  
          return {'value': {'product_name': prod.name, 'product_uom': prod.uom_id.id, 'product_std_cost': prod.standard_price},
                  'warning': warning,
                  }
      return {}
  </code></pre>
  
  <p>My write object function here:</p>
  
  <pre class="lang-py prettyprint-override"><code>def fnct_trigger_onchange(self,cr,uid,ids,b_flags,context=None):
          """
          @if b_flags is true means onchange function in this object was triggered
          @if b_flags is false means onchange function in this object was not triggered
          """
          res = {} 
  
          """
          @if b_flags is true then reset the Note Change field to empty
          """
          if b_flags:
              lab_obj= self.pool.get('test.lab')
              strResetEmpty=" "
              if not isinstance(ids, list):
                  ids = [ids]
  
              res_vals = {'note_change':strResetEmpty
                          }
              lab_obj.write(cr, uid, ids, res_vals, context=context)           
  
          return res
  </code></pre>
  
  <p>My XML here:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
     &lt;form string="lab_form_view" version="7.0"&gt;    
     &lt;notebook&gt;
     &lt;page string="Lab Products"&gt;
            &lt;field name="lab_lines" widget="one2many_list" context="{'test':active_id}" &gt;
               &lt;tree string="Components" editable="bottom"&gt;                                            
                      &lt;field name="product_id" required="1" context="{'default_supply_method':'produce'}" on_change="onchange_product_id(product_id, product_name, context)" /&gt;
                      &lt;field name="product_name" invisible="1"/&gt;                                    
                &lt;/tree&gt;
            &lt;/field&gt;                                                  
       &lt;/page&gt;
       &lt;/notebook&gt;
  
       &lt;group colspan="4" string= "Remark Notes"&gt;
                 &lt;field name="note_change" /&gt;                   
       &lt;/group&gt;
       &lt;/form&gt; 
  </code></pre>
  
  <p>Through this i can trigger the write object function in fnct_trigger_onchange when selecting new product in one2many list to clear my clear text content in ROC field. However this is not yet what i want, the problem of my current code is  the text (in ROC field) was cleared at background but not present/reflected in user view. The user still saw the old text even it actually was cleared.  </p>
  
  <p>I wish to achieve what as on_change method done where once user select product, the ROC field will immediately empty. How can i do that? Can anyone help me on this? Thanks !!    </p>