[FIX] looping over invoices to write a message from reccuring invoice create

This commit is contained in:
Harshad
2020-08-06 21:50:25 +05:30
parent 145692af31
commit dcc55ee073

View File

@@ -524,8 +524,9 @@ class ContractContract(models.Model):
This method triggers the creation of the next invoices of the contracts
even if their next invoicing date is in the future.
"""
invoice = self._recurring_create_invoice()
if invoice:
invoices = self._recurring_create_invoice()
if invoices:
for invoice in invoices:
self.message_post(
body=_(
'Contract manually invoiced: '
@@ -534,7 +535,7 @@ class ContractContract(models.Model):
)
% (invoice._name, invoice.id)
)
return invoice
return invoices
@api.multi
def _recurring_create_invoice(self, date_ref=False):