Skip to content

Commit

Permalink
remove cron stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
damdam-s authored and etobella committed Feb 21, 2024
1 parent 6542a56 commit f45167c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
14 changes: 0 additions & 14 deletions contract/data/contract_cron.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,4 @@
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
<record model="ir.cron" id="contract_cron_for_invoice_manually_invoice">
<field
name="name"
>Generate Recurring Invoices from Contracts (using button Process manually)</field>
<field name="model_id" ref="model_contract_contract" />
<field name="state">code</field>
<field name="code">model.cron_generate_invoices_manually()</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
<field eval="False" name="active" />
</record>
</odoo>
17 changes: 0 additions & 17 deletions contract/models/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,6 @@ def write(self, vals):
res = super(ContractContract, self).write(vals)
return res

def cron_generate_invoices_manually(self, date=None, domain=None):
if date is None:
date = fields.Date.today()

if domain is None:
domain = []

domain = expression.AND(
[domain, self._get_contracts_to_invoice_domain(date_ref=date)]
)

contracts = self.search(domain)
for contract in contracts:
contract.generate_invoices_manually(date=date)

return True

def generate_invoices_manually(self, date=None):
if date is None:
date = fields.Date.today()
Expand Down

0 comments on commit f45167c

Please sign in to comment.