Odoo Help

3 Answers
9/2/13, 4:44 AM

Add :

<field name="functional_dep" invisible="True"/>

In the tree view of the "func_details_inno" field like that :

    <!-- <field name="activity">
    <field name="activities"/>
    <field name="person"/>
    <field name="start"/>
    <field name="end"/>
    </field> -->
    <field name="functional_dep" invisible="True"/>
    <field name="activity"/>
    <field name="yes"/>
    <field name="no"/>
    <field name="na"/>
    <field name="reason" />
    <field name="risks" />
Shaumyadeep Chaudhuri
9/2/13, 5:31 AM

Thanks for your reply but the problem is not that i want to hide a particular column, it can simply be achieved by not including the field in the tree view at all. The problem is i want to filter rows in the tree view and hence the requirement for using domains

9/2/13, 5:32 AM

Yes, but in my memories, if you want to filter on a field, you need to have this field in the tree view.

Shaumyadeep Chaudhuri
9/2/13, 5:37 AM

the functional_dep field is already there and it doesn't need to be invisible, i want to show only those rows which belong to a particular functional field, innovation in this case, there might be other records in the table which have some other functional_dep value

9/2/13, 9:27 AM

functional_dep field is not in the tree. (not in the code you post on pastebin)

Shaumyadeep Chaudhuri
9/2/13, 9:47 AM

oh sorry, i had added it later after posting it. but it doesn't help

9/2/13, 10:23 AM

Ok, can you post again your code on pastebin ? (To have the latest version)

Shaumyadeep Chaudhuri
9/6/13, 4:13 AM

yes sure, but theere aren't many big changes, here's the code http://pastebin.com/uVEReG7P

Purnendu Singh (psi)
3/31/14, 4:15 AM

class one2many_mod2(fields.one2many):

def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
    if context is None:
        context = {}
    if not values:
        values = {}
    res = {}
    for id in ids:
        res[id] = []
    ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'in',ids),('state', '=', 'open')], limit=self._limit)
    for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
        res[r[self._fields_id]].append( r['id'] )
    return res

class res_partner(osv.osv):

_inherit = 'res.partner'
_columns = {
    'partner_scheduled_calls': one2many_mod2('crm.phonecall', 'partner_id', 'Scheduled Calls', ),


this will filter the scheduled calls(('state', '=', 'open')) only from all call logs.

Hope this will help


Timo Talvitie, Vizucom Oy

--Timo Talvitie, Vizucom Oy--
| 5 4 7
Tampere, Finland
--Timo Talvitie, Vizucom Oy--

Lead developer at Vizucom.

Timo Talvitie, Vizucom Oy
1/5/14, 8:17 PM

This post at Launchpad discusses the issue, but it doesn't make it clear whether it is really a bug or simply by design. I had the same issue and tried two possible solutions:

1) Change the field to many2many if you have control over the field types. Domain filtering works fine with m2m fields, or

2) Follow this post by Andreas Brueckl that shows a way to do o2m filtering with a functional field and its fnct_inv parameter

They both worked, but converting relationships that clearly should be o2m to m2m just to get access to filtering functionality feels a bit wrong, so I ended up using solution #2.

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform 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.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now