def _compute_qty_returned(self):
        for line in self:
            qty = 0.0
            for move in line.move_ids.filtered(
                    lambda m: m.state == 'done' and
                    m.location_id.usage != 'supplier' and m.to_refund):
                qty += move.product_uom._compute_quantity(
                    move.product_uom_qty,
                    line.product_uom)
            line.qty_returned = qty