Support taxes defined on account deposit

issue5916
review25691002
This commit is contained in:
Cédric Krier committed 2016-10-05 21:04:53 +02:00
1 parent 8c536630fc
commit 80f855add7
2 files changed
+11 -6

No files matched your search

+3 -1
View File
@@ -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
* Initial release
+8 -5
View File
@@ -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):