=== modified file 'account_payment_discount_extension/account_payment_discount.py' --- account_payment_discount_extension/account_payment_discount.py 2010-09-15 10:48:59 +0000 +++ account_payment_discount_extension/account_payment_discount.py 2010-09-15 14:57:36 +0000 @@ -47,7 +47,7 @@ payment_data = self.pool.get('account.payment.term').browse(cr, uid, inv.payment_term.id).cash_discount_ids if payment_data: delay = payment_data[0].delay - self.write(cr, uid, [inv.id], {'next_payment_date':(datetime.now() + relativedelta(days=delay)).strftime('%Y-%m-%d')}) + self.write(cr, uid, [inv.id], {'next_payment_date':(DateTime.strptime(inv.date_invoice, '%Y-%m-%d') + DateTime.RelativeDateTime(days=delay)).strftime('%Y-%m-%d')}) return data def _next_date(self, cr, uid, ids, context=None):