changeset 3860ddbea61c in modules/account_tax_cash:5.2
details: 
https://hg.tryton.org/modules/account_tax_cash?cmd=changeset;node=3860ddbea61c
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 c876ed94a702 -r 3860ddbea61c account.py
--- a/account.py        Mon May 06 14:59:39 2019 +0200
+++ b/account.py        Mon Jun 03 15:27:41 2019 +0200
@@ -275,7 +275,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
@@ -303,6 +302,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)

Reply via email to