Browse Source

[10.0] contract: allow to limit records on cron

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

2
contract/__manifest__.py

@ -9,7 +9,7 @@
{ {
'name': 'Contracts Management - Recurring', 'name': 'Contracts Management - Recurring',
'version': '10.0.4.2.1',
'version': '10.0.4.3.0',
'category': 'Contract Management', 'category': 'Contract Management',
'license': 'AGPL-3', 'license': 'AGPL-3',
'author': "OpenERP SA, " 'author': "OpenERP SA, "

4
contract/models/account_analytic_account.py

@ -294,7 +294,7 @@ class AccountAnalyticAccount(models.Model):
return invoices return invoices
@api.model @api.model
def cron_recurring_create_invoice(self):
def cron_recurring_create_invoice(self, limit=None):
today = fields.Date.today() today = fields.Date.today()
contracts = self.with_context(cron=True).search([ contracts = self.with_context(cron=True).search([
('recurring_invoices', '=', True), ('recurring_invoices', '=', True),
@ -302,7 +302,7 @@ class AccountAnalyticAccount(models.Model):
'|', '|',
('date_end', '=', False), ('date_end', '=', False),
('date_end', '>=', today), ('date_end', '>=', today),
])
], limit=limit)
return contracts.recurring_create_invoice() return contracts.recurring_create_invoice()
@api.multi @api.multi

Loading…
Cancel
Save