Odoo Help


How to using fnct_search from another table

on 6/9/15, 10:31 PM 766 views

hi every one, i have case : in purchase_order_line , there is a field: balance_qty. then i show this field ( named balancepo_qty ) on tree view of product.product object with function field. now, i cannot to filter it, since it a field function not store in db of product_product. this is a part of my code : result={} ids=[] if args: line_obj = self.pool.get('purchase.order.line') # line_ids = po_obj.search(cr,uid,[('product_id', '=', product.id),('balance_qty','>=',1)]) product_ids = self.pool.get('product.product').search(cr,uid,[]) for product in self.browse(cr, uid, product_ids, context=context): # po_id = product.order_id.id # po_balance_qty = product.order_id.balance_qty result[product.id] = 0 line_ids = line_obj.search(cr, uid, [('product_id', '=', product.id),('balance_qty','>=',1)]) for line in line_obj.browse(cr, uid, line_ids): result[product.id] += line.balance_qty please any one help me. thanks in advance

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: 6/9/15, 10:31 PM
Seen: 766 times
Last updated: 6/9/15, 10:35 PM