Reviewers: ,
Please review this at http://codereview.tryton.org/183002/ Affected files: M purchase.py Index: purchase.py =================================================================== --- a/purchase.py +++ b/purchase.py @@ -10,11 +10,10 @@ 'Week Days') def compute_supply_date(self, product_supplier, date=None): - res = super(ProductSupplier, self).compute_supply_date( + date = super(ProductSupplier, self).compute_supply_date( product_supplier, date=date) earlier_date = None - date = res[0] - next_date = res[1] + new_date = None for day in product_supplier.weekdays: weekday = int(day.weekday) diff = weekday - date.weekday() @@ -26,12 +25,7 @@ continue earlier_date = new_date - diff = weekday - next_date.weekday() - if diff < 0: - diff += 7 - new_next_date = next_date + datetime.timedelta(diff) - res = (new_date, new_next_date) - return res + return new_date def compute_purchase_date(self, product_supplier, date): earlier_date = None -- [email protected] mailing list
