Browse Source

[10.0] contract: allow to limit records on cron

pull/261/head
David 6 years ago
committed by Jairo Llopis
parent
commit
e6c330bd0c
No known key found for this signature in database GPG Key ID: 59564BF1E22F314F
  1. 4
      contract/models/account_analytic_account.py

4
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

Loading…
Cancel
Save