Odoo - Change domain on inherited view
<p>I am currently working on building a custom module, and I extended the unit of measure class (product.uom).  I want some uom entries to be removed from the list/tree views, based on a specific value for one of my new variables.</p>

<p>I am not entirely sure how to modify this view.  I seem to be reading that I need to specify a domain, like domain = [("myvariable","=",True)], but I'm not entirely sure how to apply this.  I tried inheriting the tree view, and adding a domain, but this doesn't work.</p>

<p>Any help would be greatly appreciated.</p>

<p>Solution:</p>

<pre class="lang-xml prettyprint-override"><code>&lt;record model="ir.actions.act_window" id="uom_list_action"&gt;
    &lt;field name="name"&gt;Units Of Measurement&lt;/field&gt;
    &lt;field name="res_model"&gt;product.uom&lt;/field&gt;
    &lt;field name="domain"&gt;[("myvariable","!=",True)]&lt;/field&gt;
    &lt;field name="view_mode"&gt;tree,form&lt;/field&gt;
&lt;/record&gt;

&lt;record model="ir.ui.menu" id="product.menu_product_uom_form_action"&gt;
    &lt;field name="action" ref="uom_list_action"/&gt;
&lt;/record&gt;

&lt;record model="ir.ui.menu" id="stock.menu_stock_uom_form_action"&gt;
    &lt;field name="action" ref="uom_list_action"/&gt;
&lt;/record&gt;
</code></pre>