I made this code to compute the total quantity of the product but the answer is displaying in the view. how can i fix this?? any help please.. Stock.picking.out class...
Here's my code:
def _get_total_quantity(self, cr, uid, ids, field_name, args, context=None):
res ={}
product_qty = {}
total_quantity= {}
qty = 0.00
move_pool = self.pool.get('stock.move')
for stock_move_picking in self.browse(cr,uid,ids,context=context):
total_qty = move_pool.search(cr,uid,[('picking_id','=', stock_move_picking.id)],context = context)
for picking in move_pool.browse(cr,uid,total_qty, context=context):
qty = qty + picking.product_qty
res[stock_move_picking.id] = {'total_quantity':qty}
return res
_columns = {
'total_quantity':fields.function(_get_total_quantity, type='float', method=True,store=True, multi=True, string='Summation of Quantity', ),
}