[10.0] contract: allow to limit records on cron

This commit is contained in:
David
2019-01-14 14:52:28 +01:00
committed by Jairo Llopis
parent e56ea37b65
commit be8e768905
2 changed files with 3 additions and 3 deletions

View File

@@ -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, "

View File

@@ -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