mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[10.0] contract: allow to limit records on cron
This commit is contained in:
@@ -312,7 +312,7 @@ class AccountAnalyticAccount(models.Model):
|
||||
return invoices
|
||||
|
||||
@api.model
|
||||
def cron_recurring_create_invoice(self):
|
||||
def cron_recurring_create_invoice(self, limit=None):
|
||||
today = fields.Date.today()
|
||||
contracts = self.with_context(cron=True).search([
|
||||
('recurring_invoices', '=', True),
|
||||
@@ -320,7 +320,7 @@ class AccountAnalyticAccount(models.Model):
|
||||
'|',
|
||||
('date_end', '=', False),
|
||||
('date_end', '>=', today),
|
||||
])
|
||||
], limit=limit)
|
||||
return contracts.recurring_create_invoice()
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user