Comment 2 for bug 639645

Revision history for this message
Thomas Dreiling (thomas-dreiling) wrote :

You did not fully implement the patch posted! The "relativedelta" part has to be changed, too. Otherwise, I get the following error:
  File "/home/thomdrei/workspace/addons/account_payment_discount_extension/account_payment_discount.py", line 53, in action_date_assign
    self.write(cr, uid, [inv.id], {'next_payment_date':(DateTime.strptime(inv.date_invoice, '%Y-%m-%d') + relativedelta(days=delay)).strftime('%Y-%m-%d')})
  File "/usr/lib/pymodules/python2.6/dateutil/relativedelta.py", line 247, in __radd__
    raise TypeError, "unsupported type for add operation"
TypeError: unsupported type for add operation
It has to be "DateTime.RelativeDateTime(days=delay)).strftime('%Y-%m-%d')"