From e285f941fe6b610162923c5d084e27af440bb329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 12 Jul 2011 00:17:31 +0200 Subject: [PATCH] Remove support of Python2.5 and fix py3 warnings --- invoice.py | 3 ++- setup.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/invoice.py b/invoice.py index 2e755710e6..43b14505cc 100644 --- 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 from trytond.pool import Pool @@ -77,7 +78,7 @@ class InvoiceLine(ModelSQL, ModelView): 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) diff --git a/setup.py b/setup.py index 0ff6f02e10..9083ac3b39 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,6 @@ setup(name='trytond_account_stock_anglo_saxon', 'Natural Language :: French', 'Natural Language :: German', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Office/Business',