changeset 236431bdb04a in modules/account_tax_cash:4.8
details:
https://hg.tryton.org/modules/account_tax_cash?cmd=changeset;node=236431bdb04a
description:
Always filter out invoice without move in _update_tax_cash_basis
process and cancel can call the method on invoice without move for
example if
the invoice is empty.
issue8348
review263531002
(grafted from 8a7b4e244a0d0dc5dc4c38d26b288a544f8be6be)
diffstat:
account.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (20 lines):
diff -r 335f53e50a97 -r 236431bdb04a account.py
--- a/account.py Mon Apr 22 11:08:26 2019 +0200
+++ b/account.py Mon Jun 03 15:27:41 2019 +0200
@@ -279,7 +279,6 @@
if 'payment_lines' in values:
invoices.extend(records)
invoices = cls.browse(sum(args[0:None:2], []))
- invoices = [i for i in invoices if i.move]
cls._update_tax_cash_basis(invoices)
@classmethod
@@ -307,6 +306,8 @@
date = Transaction().context.get('payment_date', Date.today())
periods = {}
for invoice in invoices:
+ if not invoice.move:
+ continue
if invoice.company not in periods:
periods[invoice.company] = Period.find(
invoice.company.id, date=date)