Odoo Help

Welcome!

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.

0

How to using fnct_search from another table

By
henro
on 6/9/15, 10:31 PM 421 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

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

1 follower(s)

Stats

Asked: 6/9/15, 10:31 PM
Seen: 421 times
Last updated: 6/9/15, 10:35 PM