diff --git a/invoice.py b/invoice.py index 51532a051e..c1ddcd7797 100644 --- a/invoice.py +++ b/invoice.py @@ -1,8 +1,8 @@ #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 __future__ import with_statement from decimal import Decimal import base64 +import operator from trytond.model import ModelWorkflow, ModelView, ModelSQL, fields from trytond.report import Report from trytond.wizard import Wizard @@ -485,7 +485,7 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView): if line.account.id == invoice.account.id \ and line.maturity_date: lines.append(line) - lines.sort(lambda x, y: cmp(x.maturity_date, y.maturity_date)) + lines.sort(key=operator.attrgetter('maturity_date')) res[invoice.id] = [x.id for x in lines] return res diff --git a/setup.py b/setup.py index 1129c664df..15dbc9a849 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,6 @@ setup(name='trytond_account_invoice', 'Natural Language :: German', 'Natural Language :: Spanish', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Office/Business',