Skip to Content
Odoo Development Cookbook
book

Odoo Development Cookbook

by Holger Brunn, Alexandre Fayolle, Daniel Reis
April 2016
Beginner to intermediate content levelBeginner to intermediate
400 pages
9h 16m
English
Packt Publishing
Content preview from Odoo Development Cookbook

Calendar views

This recipe walks you through how to display and edit information about dates and durations in your records in a visual way.

How to do it...

  1. Define a calendar view:
    <record id="calendar_project_task" model="ir.ui.view">
        <field name="model">project.task</field>
        <field name="arch" type="xml">
            <calendar date_start="date_start" date_stop="date_end" color="project_id">
                <field name="name" />
                <field name="user_id" />
            </calendar>
        </field>
    </record>
  2. Add menus and actions using this view. This is left as an exercise for the reader.

How it works...

The calendar view needs to be passed field names in the attributes date_start and date_stop to indicate which fields to look at when building the visual representation. Use fields of type Datetime as ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Odoo Development Cookbook - Fifth Edition

Odoo Development Cookbook - Fifth Edition

Husen Daudi, Jay Vora, Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
Odoo 14 Development Cookbook - Fourth Edition

Odoo 14 Development Cookbook - Fourth Edition

Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
Odoo 12 Development Cookbook - Third Edition

Odoo 12 Development Cookbook - Third Edition

Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis

Publisher Resources

ISBN: 9781785883644Supplemental Content