Create Calendar View in Odoo 17 ERP

ANSHA
December 4, 2023
calendar-view-in-odoo-17

The redesigned calendar view in Odoo 17 is an effective scheduling tool that helps companies manage appointments, allocate resources optimally, and streamline operations. The blog discusses the features and improved capabilities of this feature, including resource allocation, flexible scheduling, and mobile accessibility. With Odoo 17’s calendar view, you can enhance your scheduling abilities, ensuring effective time management and optimizing efficiency for your team, project, or resource.

First, we should define the models and corresponding fields to create the calendar view.

create-calendar-view-in-odoo

After defining the fields, this is the view of the model. For this view, we need to produce the timetable view. For that, we need to define the XML lines under the ‘ views ’ directory of the module. In that train, we need to specify the timetable view using ‘.

Now we can move to the law that we need to produce a timetable view.

<record i="school_management_view_calendar" model="ir.ui.view">

   <field name="name">school.management.view.calendar</field>

   <field name="model">school.management</field>

   <field name="arch" type="XML">

       <calendar date_start="date" string="School Management Calendar"

              mode="month" color="name" event_open_popup="true"

             quick_add="false" date_stop="end_date">

           <field name="dob"/>

           <field name="name" avatar_field="avatar_128"/>

           <field name="st_class"/>

           <field name="division"/>

       </calendar>

   </field>

</record>

Then, we want to define the view type calendar in the action.

<record id="school_action" model="ir.actions.act_window">

   <field name="name">School Management</field>

   <field name="res_model">school.management</field>

   <field name="view_mode">tree,form,calendar</field>

</record>

In the calendar view, we can see multiple attributes like date_start, and date_end.  Let’s explain one by one,

date_start -Indicates the starting date of the calendar event.

 date_stop – Indicates the ending date of the calendar event.

mode-There are three calendar views: daily, weekly, and monthly. Upon loading, the Calendar view appears in its default mode. There are three possible values for this variable: Day, Week, and Month.

color – Depending on the given field (usually many2one), this provides color for various occurrences. Records will have the same color if this field has the same value.

event_open_popup -This will open the event as a popup. If event_open_popup=true, the view extending from the calendar will open as a popup. It will open a form of events if it does not.

Let’s look at the view, we are able to see that the icon calendar is added in the view,

icon-calendar-odoo

After clicking the calendar view, we will be able to see the records as displayed in the view.

records-as-displayed

The colored area shows that records are within that date. In the picture, we can see that the records are filtered by month, and we can change this to day, week, and year.

odoo-calendar-view

If we set mode =’day’, then the view will be,

set mode = ‘year’, then the view will be,

If we set mode = ‘week’, then the view will be,

Also, we are able to filter our records by the many2one field that we set as the avatar_field.

In the above image, we can see that only Azure Interior records are available because we enabled the checkbox for that avatar_field.

Also, we will be able to see the created records by clicking on them.

We can quickly create a new record by clicking on the date that we want to create the record.

calendar-view-in-odoo

Because of odoo 17’s mobile accessibility, customizable options, and integrated capabilities, it allows enterprises to enhance productivity while streamlining operations.

"Unlock the Full Potential of Your Business with Odoo ERP!"

"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"

Get a Free Quote

Leave a Reply

Your email address will not be published. Required fields are marked *