Reviewers: ,
Please review this at http://codereview.tryton.org/49006/ Affected files: M invoice.py Index: invoice.py =================================================================== --- a/invoice.py +++ b/invoice.py @@ -1,6 +1,7 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. from decimal import Decimal +import operator from trytond.model import ModelView, ModelSQL, fields @@ -75,7 +76,7 @@ elif line.invoice.type == 'out_credit_note': type_ = 'in_customer' - moves.sort(lambda x, y: cmp(x.effective_date, y.effective_date)) + moves.sort(key=operator.attrgetter('effective_date')) cost = move_obj.update_anglo_saxon_quantity_product_cost( line.product, moves, line.quantity, line.unit, type_) cost = currency_obj.round(line.invoice.currency, cost) -- [email protected] mailing list
