Reputation: 2457
on my object, I have a link to 'product.product'
as many2one field, in my object view, I registered product_id
field:
class my_object(osv.osv):
_columns = {
'product_id': fields.many2one('product.product', 'Product'),
}
<field context="{'group_by':'categ_id','search_default_filter_to_sell':1}" name="product_id" />
(Please take a look at 'product.product' search view at addons/products/product_view.xml)
when i select "Search More ..."
option from dropdown, the tree view will just filtered by 'search_default_filter_to_sell'
and group_by
filter is not activated, I tried all available group_by
filters from product.product
search view and no thing happen.
all objects with search-view that have group_by filter has this issue when you link them with many2one relation.
is this a bug? or i did something wrong?
I'm using Openerp v7.0, windows7, firefox21.
Upvotes: 2
Views: 1582
Reputation: 700
I don't quite get your question, is product_id
a simple many2one field or a many2one type relational field or a many2one type functional field? What "Search More ..." option did you select (a screenshot will be helpful)?
Also, this is how I define a filter in OpenERP 7.0:
<filter string="Wenshan" icon="terp-personal"
domain="[]" context="{'group_by': 'wenshan_id'}"/>
Upvotes: 0
Reputation: 200
You want default filter with two condition, in which one is group by 'categ_id' and second is 'to_sell':
First create filter for this condition :
<record id="view_product_filter" model="ir.ui.view">
'''''
'''''
<search>
<field context="{'group_by':'categ_id'}" domain="[('to_sell','=',True))]" name="product_id" />
</search>
'''''''
</record>
and after call default filter in "ir.actions.act_window":
<field name="search_view_id" ref="view_product_filter"/>
<field name="context">{'search_default_product_id':1}}</field>
It will help u...
Upvotes: 0