Advanced Views - Calendar View in Odoo 17

CelineGeorge1 444 views 11 slides Apr 30, 2024
Slide 1
Slide 1 of 11
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11

About This Presentation

As Odoo is a comprehensive business management software suite, the Calendar view is a powerful tool used to visualize and manage events, tasks, meetings, deadlines and other time-sensitive activities across various modules such as CRM, Project management, HR modules and more.
In this slide, we can j...


Slide Content

Advanced Views - Calendar View in Odoo 17 Enterprise

Introduction Enterpr ise As Odoo is a comprehensive business management software suite, the Calendar view is a powerful tool used to visualize and manage events, tasks, meetings, deadlines and other time-sensitive activities across various modules such as CRM, Project management, HR modules and more. In this slide, we can just go through the the steps of creating a calendar view for a module in Odoo 17.

Enterprise First, lets create a module, here for example hospital_management. Lets create a simple model which stores data of the patients visited. And just define some basic fields, menus, tree view, form view for the model. Create some records as for example

Enterprise Creating the Calendar view Under the ‘views’ directory, we’ve defined an xml file where all the views are defined. Create a calendar view for the model using the <calendar> tag in the same file.

Enterprise First, add the calendar view also in the view_mode of the action for the model. <record id="action_view_patient_card" mo del="ir.actions.act_window"> <field name="name">Patient Card</field> <field name="res_model">patient.details</field> <field name="view_mode">tree,form,calendar</field> </record>

Enterprise Lets check the xml code we’ve created for the calendar view <!-- PATIENT DETAILS CALENDAR VIEW → <record id="patient_details_view_calendar" model="ir.ui.view"> <field name="name">patient.details.view.calendar</field> <field name="model">patient.details</field> <field name="arch" type="xml"> <calendar string="Patients List" date_start="consult_start_date" date_stop="consult_end_date" event_open_popup="form" mode="month" color="patient_name_id"> <field name="patient_id"/> <field name="patient_name_id" avatar_field="image_1920"/> <field name="create_date"/> </calendar> </field> </record>

Enterprise Here, there are some attributes used for the calendar view. Let’s check, for what each of them are used. date_start : Name of the field holding the start date for the calendar event. If we provide this, Odoo will take the value of this field’s value as the starting date. Datetime fields are given here. date_end : Ending date of the calendar event event_open_popup : If set to true, the calendar view will open events (or records) in a FormViewDialog. Otherwise, it will open in a new form (do_action) mode : Specifies the default mode of displaying the calendar data. Possible values are year, month, week and day.

Enterprise color : To show the records in different color based on a particular field. That field name can be given as the value here. It’ll be shown as checkboxes on the sidebar of the window. string : The text string to display. Along with these, form_view_id, quick_create, create, delete, etc can also be used as attributes.

Enterprise Thus, the Calendar view will look like

Enterprise On clicking on any of the grid, a popup window will open These marked fields are those which we’ve added inside the calendar view using <field> tag

For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com