diff --git a/invoice.py b/invoice.py index 2151cc002d..c5577cd5dc 100644 --- a/invoice.py +++ b/invoice.py @@ -99,9 +99,9 @@ class Invoice: Commission.save(to_save) def _credit(self): - values = super(Invoice, self)._credit() - values['agent'] = self.agent.id if self.agent else None - return values + credit = super(Invoice, self)._credit() + credit.agent = self.agent + return credit class InvoiceLine: