diff --git a/CHANGELOG b/CHANGELOG index b43a07b7a6..183fabd22d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Support taxes defined on account deposit + Version 4.0.0 - 2016-05-02 * Bug fixes (see mercurial logs for details) * Add Python3 support @@ -6,4 +8,4 @@ Version 3.8.0 - 2015-11-02 * Bug fixes (see mercurial logs for details) Version 3.6.0 - 2015-04-20 -* Initial release \ No newline at end of file +* Initial release diff --git a/invoice.py b/invoice.py index 32598bb0e1..eb471cd13f 100644 --- a/invoice.py +++ b/invoice.py @@ -115,26 +115,29 @@ class DepositRecall(Wizard): if line.account == self.start.account: to_delete.append(line) if amount < 0: - line = self._get_invoice_line(amount) - line.invoice = invoice - line.company = invoice.company + line = self._get_invoice_line(invoice, amount) line.sequence = max(l.sequence for l in invoice.lines) line.save() if to_delete: InvoiceLine.delete(to_delete) return 'end' - def _get_invoice_line(self, amount): + def _get_invoice_line(self, invoice, amount): pool = Pool() Line = pool.get('account.invoice.line') - return Line( + line = Line( + invoice=invoice, + company=invoice.company, type='line', quantity=1, account=self.start.account, unit_price=amount, description=self.start.description, ) + # Set taxes + line.on_change_account() + return line class DepositRecallStart(ModelView):