mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] looping over invoices to write a message from reccuring invoice create
This commit is contained in:
@@ -524,17 +524,18 @@ class ContractContract(models.Model):
|
|||||||
This method triggers the creation of the next invoices of the contracts
|
This method triggers the creation of the next invoices of the contracts
|
||||||
even if their next invoicing date is in the future.
|
even if their next invoicing date is in the future.
|
||||||
"""
|
"""
|
||||||
invoice = self._recurring_create_invoice()
|
invoices = self._recurring_create_invoice()
|
||||||
if invoice:
|
if invoices:
|
||||||
self.message_post(
|
for invoice in invoices:
|
||||||
body=_(
|
self.message_post(
|
||||||
'Contract manually invoiced: '
|
body=_(
|
||||||
'<a href="#" data-oe-model="%s" data-oe-id="%s">Invoice'
|
'Contract manually invoiced: '
|
||||||
'</a>'
|
'<a href="#" data-oe-model="%s" data-oe-id="%s">Invoice'
|
||||||
|
'</a>'
|
||||||
|
)
|
||||||
|
% (invoice._name, invoice.id)
|
||||||
)
|
)
|
||||||
% (invoice._name, invoice.id)
|
return invoices
|
||||||
)
|
|
||||||
return invoice
|
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _recurring_create_invoice(self, date_ref=False):
|
def _recurring_create_invoice(self, date_ref=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user