Enable Dark Mode!
creating-calendar-view-odoo-13.png
By: Mohammed Shahil

How to Create Calendar View in Odoo 13

Calendars primarily support the setting of a specific date that is useful for scheduling meetings. It helps in easy prioritizing and reviewing activities scheduled for a specific time frame. However, this technique can also be used to complete specific tasks on your to-do list. Moreover, the calendar in Odoo holds the users responsible for their actions. 
This blog will provide an insight to you on how to visually display and edit date details in your records in the calendar view of Odoo 13. 


Calendar View:
In Odoo, as the name suggests, this view type reflects the calendar type record illustration. Therefore, it can be viewed in three different formats like that of the calendar such as a Day, Week, and Month.
The operation of creating a calendar view can be well explained with the help of an example as shown below:

<record id="mobile_service_view_calendar" model="ir.ui.view">
   <field name="name">mobile.service.calendar</field>
   <field name="model">mobile.service</field>
   <field name="arch" type="xml">
       <calendar string="Service Request"
                 date_start="date_request"
                 date_stop="return_date"
                 event_open_popup="true"
                 mode="month"
                 color="person_name"
                 quick_add="False">
           <field name="person_name"/>
           <field name="technician_name"/>
       </calendar>
   </field>
</record>

Let me describe the above example code and its attributes:
In a daily, weekly, or monthly calendar, calendar views display records as events and the < calendar > is the root part.

Attributes of the calendar view are:

date_start:
Name of the field to record the start date of the event.

date_stop:
Name of the field to record the end date of the event. Moreover, If date_stop is provided in the record, the record becomes movable in the calendar.

date_delay:
An alternative to date_stop indicates the length of the event rather than the end date. 

color:
Name of the color segmentation record field to be used. Additionally, the records are assigned by the same highlight color in the calendar as in the same color line, colors are allocated semi-randomly.

form_view_id:
Open view when an event is generated or modified by the user. In addition, remember that if this attribute is not set, the calendar views in the current action, if any, will fall back to the ID of the form view.

event_open_popup:
If the event_open_popup="true" then the view in the calendar event window opens as a popup of a form view. Otherwise, it will open events in a new form of view.

quick_add:
Allows the creation of a fast event via instant click. The click asks the user for a name and via entering the name along with the time for the event, one can quickly create a new event. Off the chance, if quick creation fails, it returns to a full form dialogue. 

all_day:
Name of the record boolean field indicating whether the corresponding event is flagged as day-long (and irrelevant for the duration) 

mode:
Default view mode when the calendar is loaded. Possible attributes are: day, week, month 

<field>:
The field shown in the calendar cards.

Note: Don’t forget to add the calendar to  view_mode in action views.

<record id="action_mobile_service_request" model="ir.actions.act_window">
   <field name="name">Service Request</field>
   <field name="res_model">mobile.service</field>
   <field name="view_mode">calendar,tree,form,kanban,pivot,graph</field>
   <field name="help" type="html">
       <p class="oe_view_nocontent_create">
           Click to Create a New Record.
       </p>
   </field>
</record>
The following image shows the calendar configuration done for the mobile services operation. Moreover, you can see that the appointments are being described along with the technician's name and the date of operation.

creating-calendar-view-odoo-13-cybrosys

Like wide you can create a calendar view for all the aspects of the Odoo operations and this will act as a useful tool in supervising and prioritizing your day-to-day activities.


If you need any assistance in odoo, we are online, please chat with us.



3
Comments

Marco Alejandro

Hello, I'm trying to make a custom calendar view in Odoo 13 for stock.picking, I already built the view, but I need the cards to show the partner's name (customer name) as main text. Currently the cards show only the name of the stock.picking record, I've tried adding inside the view, but it doesn't change something. Do you know how to do it?

30/01/2020

-

1:06PM

Jose

Hello, how i can disable previous dates than today in calendar view?

29/10/2020

-

3:20AM

Stephen Wrightly

Great post and very nicely written.

06/01/2020

-

6:07AM



Leave a comment

 
whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

London

Cybrosys Limited
Alpha House,
100 Borough High Street, London,
SE1 1LB, United Kingdom

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message