Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


filter on many2many fields

Sam path
on 4/30/14, 12:21 PM 1,662 views

Hi all

the properties field in sale.order.line model is a many2many field which display all the properties available and wont filter based on anything. So, I've created a field in sale_stock.py

'group_id': fields.many2one('mrp.property.group', 'Property Group', select=True),
and changed the default property_ids field as below,
        'property_ids': fields.many2many('mrp.property', 'sale_order_line_property_rel', 'order_id', 'property_id', 'Properties', readonly=True, states={'draft': [('readonly', False)]}, domain="[('group_id.name', '=', group_id.name)]"),

and changed sale_stock.xml

<field name="group_id" widget="selection"/>
<field name="property_ids" widget="selection" groups="sale.group_mrp_properties" domain="[('group_id.name', '=', 'group_id.name')]"/>

But i'm not getting any filter of the list so can any one please help me out?

You can leave out .name and the second group_id should not have '

Josse Colpaert (jco)
on 4/30/14, 7:29 PM

Sorry josse I didnt get you which second group_id

Sam path
on 5/1/14, 7:57 AM


Josse Colpaert (jco)
on 5/1/14, 1:56 PM

Thanks Josse, I tried this but there is no error but there is no filter of the dropdown list

Sam path
on 5/2/14, 2:31 AM

an anyone help me on this i'm in great trouble please help me out

Sam path
on 5/12/14, 3:29 AM

Jagdish Panchal

--Jagdish Panchal--
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 5/1/14, 2:28 AM


Below link may help you




thanks for your help Jack but nothing works all throws different errors. Please can you help me out in any way

Sam path
on 5/1/14, 1:53 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 4/30/14, 12:21 PM
Seen: 1662 times
Last updated: 3/16/15, 8:10 AM