I have 3 fields which in my module page.2 are for product categories and 1 for product. The categories fields consist of different categories. Now I want to add filter so that what ever category I set in the field, only those product should list in the products field . It is a type of sorting or filtering. I dont have much idea of using filter in such a scenerio under form view. Here is my code.py:
class deg_form(osv.osv):
_name = "deg.form"
_columns = {
'categ1':fields.many2one('product.category','Parent Category'),
'categ2':fields.many2one('product.category','Child Category'),
'my_products':fields.many2one('product.product','Products',size=64),
}
deg_form()
and here is its xml:
<record id="mywin_form_view" model="ir.ui.view">
<field name="name">mywin.form</field>
<field name="model">deg.form</field>
<field eval="7" name="priority"/>
<field name="arch" type="xml">
<form string="FORM DATA" version="7.0">
<h1>
<label for="categ1" string="Parent category"/>
<field name="categ1" />
</h1>
<h1>
<label for="categ2" string="Child category"/>
<field name="categ2" />
</h1>
<newline/>
<h1>
<label for="my_products" string="Products" domain = "[('categ1','=',True)]"/>
<field name="my_products"/>
</h1>
<button name="show_product" string="SHOW PRODUCT" type="action"/>
</form>
</field>
</record>
please help me fix this