From 4fbe87bcc5db99db51305591422096c36cf68ee7 Mon Sep 17 00:00:00 2001 From: Nathanael Perat Date: Tue, 29 Nov 2011 18:26:26 +0100 Subject: [PATCH] Method compute_supply_date returns 1 date compute_supply_date used to return 2 dates, 1 for the supply date and 1 for the next date. Now it returns only the supply date issue 2300 review 184001 --- CHANGELOG | 2 ++ purchase.py | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9e84f65cae..03b5628c1b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* compute_supply_date returns only one date + Version 2.2.0 - 2011-10-25 * Bug fixes (see mercurial logs for details) diff --git a/purchase.py b/purchase.py index b2d7d7bb47..313f0b85c0 100644 --- a/purchase.py +++ b/purchase.py @@ -1302,7 +1302,7 @@ class PurchaseLine(ModelSQL, ModelView): vals['planned_date'] = \ product_supplier_obj.compute_supply_date( product_supplier, - date=line.purchase.purchase_date)[0] + date=line.purchase.purchase_date) break with Transaction().set_user(0, set_context=True): @@ -1562,15 +1562,13 @@ class ProductSupplier(ModelSQL, ModelView): :param product_supplier: a BrowseRecord of the Product Supplier :param date: the date of the purchase if None the current date - :return: a tuple with the supply date and the next one + :return: the supply date ''' date_obj = Pool().get('ir.date') if not date: date = date_obj.today() - next_date = date + datetime.timedelta(1) - return (date + datetime.timedelta(product_supplier.delivery_time), - next_date + datetime.timedelta(product_supplier.delivery_time)) + return date + datetime.timedelta(product_supplier.delivery_time) def compute_purchase_date(self, product_supplier, date): '''