Odoo v9 - Using Onchange, how do you clear what is already entered in a field?
<p>I am extending product.template, and I've added a field called uom_class.  When I change this field when editing a product, I'd like to clear what is entered in the Many2One field called "Unit of Measure" (uom_id in product.template). I am doing this because I am also changing the domain for the uom_id, and the existing selection ("Units" by default) will probably not be in that domain.</p>

<p>I've tried the following, as suggested for earlier versions, but it did not work.</p>

<pre><code>@api.onchange('uom_class')
    def onchange_uom_class(self):
      # [...] not shown: previously set new domain for uom_id
      result['value'] ={'uom_id':False}
      return result
</code></pre>

<p>I've seen other posts suggest I need to add assign it an empty product.uom record, but I have no idea how to do that.  Any help would be greatly appreciated.</p>

<p>Well, I figured this one out.  </p>

<p>I just declared</p>

<pre><code>uom_id = False
</code></pre>

<p>For some reason, returning the domain works, but not returning the value.  Either that, or I just have no idea what I'm doing and I'm returning the value wrong... which is entirely possible.</p>

python model openerp