From be8e7689054dae0fbfbcefb30e9c995de829bdc0 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/__manifest__.py | 2 +- contract/models/account_analytic_account.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contract/__manifest__.py b/contract/__manifest__.py index 038d8838f..54250c1cb 100644 --- a/contract/__manifest__.py +++ b/contract/__manifest__.py @@ -9,7 +9,7 @@ { 'name': 'Contracts Management - Recurring', - 'version': '10.0.4.2.1', + 'version': '10.0.4.3.0', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "OpenERP SA, " diff --git a/contract/models/account_analytic_account.py b/contract/models/account_analytic_account.py index ee0f6ee94..3cc9e427b 100644 --- a/contract/models/account_analytic_account.py +++ b/contract/models/account_analytic_account.py @@ -294,7 +294,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), @@ -302,7 +302,7 @@ class AccountAnalyticAccount(models.Model): '|', ('date_end', '=', False), ('date_end', '>=', today), - ]) + ], limit=limit) return contracts.recurring_create_invoice() @api.multi