<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <data noupdate="1">
        <!-- Monthly SPENCO Status Report Cron Job -->
        <record id="cron_monthly_report" model="ir.cron">
            <field name="name">SPENCO Status Report (Monthly)</field>
            <field name="active" eval="True"/>
            <field name="priority">10</field>
            <field name="interval_number">1</field>
            <field name="interval_type">months</field>
            <field name="numbercall">-1</field>
            <field name="doall" eval="False"/>  <!-- Ensures the cron doesn't run missed calls -->
            <field name="nextcall" eval="(datetime.utcnow().replace(day=1, month=(datetime.utcnow().month % 12) + 1) - timedelta(days=1)).replace(hour=19, minute=0, second=0).strftime('%Y-%m-%d %H:%M:%S')"/>
            <field name="model_id" ref="model_sos_report_generator"/>
            <field name="state">code</field>
            <field name="code">model.generate_and_save_pdf()</field>
        </record>
    </data>
     <!-- <record id="cron_downgrade_expired_spenco_statuses" model="ir.cron">
        <field name="name">Auto Downgrade Old Spenco Statuses</field>
        <field name="model_id" ref="model_sos_case_diary_line"/>
        <field name="state">code</field>
        <field name="code">model.check_expired_status()</field>
        <field name="interval_number">1</field>
        <field name="interval_type">days</field>
        <field name="numbercall">-1</field> 
        <field name="active">True</field>
    </record> -->
</odoo>
