Fill in payment's invoice field in workflow_to_end. This fixes the test.

This commit is contained in:
Albert Cervera i Areny 2020-11-28 00:21:48 +01:00
parent 2efd7155c3
commit 8a72254f8d
1 changed files with 4 additions and 4 deletions

View File

@ -102,7 +102,7 @@ class Sale(metaclass=PoolMeta):
if to_post:
Invoice.post(to_post)
to_write = []
to_save = []
to_do = []
for sale in sales:
posted_invoice = None
@ -118,13 +118,13 @@ class Sale(metaclass=PoolMeta):
# and both parties must be the same
if payment.party != invoice.party:
payment.party = invoice.party
to_write.extend(([payment], payment._save_values))
payment.invoice = posted_invoice
to_save.append(payment)
if sale.is_done():
to_do.append(sale)
if to_write:
StatementLine.write(*to_write)
StatementLine.save(to_save)
if to_do:
cls.do(to_do)