From e6c330bd0cc8249e6392fcd6c701b3105fe0fcbd Mon Sep 17 00:00:00 2001 From: David Date: Mon, 14 Jan 2019 14:52:28 +0100 Subject: [PATCH] [10.0] contract: allow to limit records on cron --- contract/models/account_analytic_account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contract/models/account_analytic_account.py b/contract/models/account_analytic_account.py index bc268f79..5aed2b99 100644 --- a/contract/models/account_analytic_account.py +++ b/contract/models/account_analytic_account.py @@ -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