how to automatically add ir.cron schedule jobs in calendar view in odoo?

39 views Asked by At

I was given a task to add all schedule jobs in ir.cron model in calendar view in odoo. I am not sure how to do it. I have looked over internet but I didn't find anything useful. Is it possible to do it?

1

There are 1 answers

0
Kareem Abuzaid On

You can add a calendar view like the one used in the planning app for example. Below is the calendar view for the planning.slot model from Odoo 15.

    <record id="planning_view_calendar" model="ir.ui.view">
    <field name="name">planning.slot.calendar</field>
    <field name="model">planning.slot</field>
    <field name="arch" type="xml">
        <calendar string="Planning" date_start="start_datetime" date_stop="end_datetime" color="color" form_view_id="%(planning_view_form_in_gantt)d" event_open_popup="true" quick_add="False" js_class="planning_calendar" mode="month" show_unusual_days="True">
            <field name="resource_id" avatar_field="avatar_128"/>
            <field name="is_hatched" invisible="1" />
            <field name="role_id" filters="1" color="color"/>
            <field name="allocated_hours" invisible="1"/>
            <field name="allocated_percentage" invisible="1"/>
            <field name="state" groups="planning.group_planning_manager"/>
        </calendar>
    </field>
</record>