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
This commit is contained in:
1 parent
62915a9896
commit
2e028d305b
1 file changed
+2
-1
+2
-1
@@ -275,7 +275,6 @@ class Invoice(metaclass=PoolMeta):
|
||||
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 @@ class Invoice(metaclass=PoolMeta):
|
||||
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)
|
||||
|
||||
Reference in new issue
Block a user