Skip to Content
Menu
This question has been flagged
2429 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

Avatar
Discard
Related Posts Replies Views Activity
2
Jan 23
23781
4
Jun 21
37400
1
Dec 20
1488
1
Apr 18
6459
3
Sep 15
8481