Odoo Help


Update function field with store=True

on 5/18/15, 10:33 AM 1,527 views

I have this situation : 

1) 'field_count' work without problem 

def _count_all(self, cr, uid, ids, field_name, arg, context=None):

Obj = self.pool['class.y']

return {

x_id: Obj.search_count(cr, uid, [('x_id', '=', x_id)], context=context)

for x_id in ids


'field_count': fields.function(_count_all, type='integer'),

2) add domain in class y for x_id

=>problem because store=False

'x_id': fields.many2one('class.x', 'X', domain="[('field_count','>',0)]"),

3) activation of domain with adding store=True for 'field_count'

=>problem of update for 'field_count'

4) add store={'class.y': (lambda self, cr, uid, ids, c={}: ids, ['x_id'], 10)} for 'field_count'

=>same problem of update for 'field_count'

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

Question tools

1 follower(s)


Asked: 5/18/15, 10:33 AM
Seen: 1527 times
Last updated: 5/18/15, 10:33 AM