Create invoice to send only for newly posted invoices
issue11434 review405301002 (grafted from 00a9ee03419ae49076d1942881b2ffd93b5d6e27) --HG-- branch : 6.0
This commit is contained in:
1 parent
efddc21af7
commit
4bc573aa4b
1 file changed
+3
-1
+3
-1
@@ -109,9 +109,11 @@ class Invoice(metaclass=PoolMeta):
|
||||
def _post(cls, invoices):
|
||||
pool = Pool()
|
||||
InvoiceChorus = pool.get('account.invoice.chorus')
|
||||
posted_invoices = {
|
||||
i for i in invoices if i.state in {'draft', 'validated'}}
|
||||
super()._post(invoices)
|
||||
invoices_chorus = []
|
||||
for invoice in invoices:
|
||||
for invoice in posted_invoices:
|
||||
if invoice.type == 'out' and invoice.party.chorus:
|
||||
invoices_chorus.append(InvoiceChorus(invoice=invoice))
|
||||
InvoiceChorus.save(invoices_chorus)
|
||||
|
||||
Reference in new issue
Block a user