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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2429
Views