Odoo Help


How to inherit calendar popup?

on 7/23/15, 4:30 AM 3,632 views

Hi guys,

I usually have no problems at all with inheritance but I can't inherit the popup dialog which is on the calendar view.
The code is in the module calender, which you can find here: https://github.com/odoo/odoo/blob/8.0/addons/web_calendar/static/src/xml/web_fullcalendar.xml#L57-70

It has the following code:

 <div t-name="CalendarView.quick_create" class="oe_calendar_quick_create openerp">
    <div class="form-group">
        <label for='name' class='control-label'>Event summary:</label>
        <input name='name' class="form-control"/>
    <t t-if="widget._buttons">
      <div class="oe_calendar_quick_create_buttons">
        <button class="openerp oe_button oe_highlight oe_calendar_quick_create_add ">Create event</button>
        <button class="oe_button oe_form_button oe_link oe_calendar_quick_create_edit" ><span>Edit Event <![CDATA[]]></span></button>

A simple question: what is the correct way to inherit this? it has no template id and/or name so how can I inherit that div t-name and add a field after this line with xpath?

<input name='name' class="form-control"/> 


"Template inheritance is performed via the t-extend directive which takes the name of the template to alter as parameter." src : https://www.odoo.com/documentation/8.0/reference/qweb.html

David Bertha
on 7/23/15, 7:26 AM

@yenthe, I noted down your issue. Definitely I will keep you updated after trying at my side. Since so many days I am facing this problem ( in some of web templates ) Before me if you have got the answer then don't hesitate to post here, otherwise I will give you answer surely within short time. I have marked this question as important.

Emipro Technologies Pvt. Ltd.
on 7/23/15, 8:54 AM

and yes, +1 from me !

Emipro Technologies Pvt. Ltd.
on 7/23/15, 8:55 AM

@david I'm aware of the t-extend but they do not seem to work on templates in another module without name/ID. @Emipro thanks! If I find a solution I will post it here too!

on 7/23/15, 9:13 AM

+1, Me too I'm trying to change the behavior of the popup ...

Ahmed M.Elmubarak
on 7/25/15, 4:16 AM

@Emipro and @Ahmed I've posted the solution to inherit these views.

on 7/30/15, 3:17 AM


| 8 8 8

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

On 7/30/15, 3:15 AM

Hi guys,

The solution is to create a (new) XML file under /static/src/xml and to include this file in your __openerp__.py. For inheriting this view you need to work with <templates> in place of <openerp><data>.
With a t-extend you can extend the view. For example for the calendar popup:

 <?xml version="1.0" encoding="utf-8"?>
    <tr t-extend="CalendarView.quick_create">
        <t t-jquery=".form-group" t-operation="after">
            <div class="form-group">
                <h3>Example - put fields here </h3>

Thats it!

+1, Thanks I will test and let you know Yenthe. You're a star !

Emipro Technologies Pvt. Ltd.
on 7/30/15, 3:33 AM

@yenthe, I am so sorry that I couldn't got a time to give you solution.

Emipro Technologies Pvt. Ltd.
on 7/30/15, 3:34 AM

Thanks Emipro! It doesn't matter that you didn't have a solution yet, I have one now and I hope it saves you some time too :)

on 7/30/15, 5:13 AM

@Yenthe: I would like to add custom many2one field in calendar pop up after inheriting the template CalendarView.quick_create. Is it possible?. And override Create Event button to save many2one field in the form (project.task). Thanks

on 2/9/16, 10:08 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 7/23/15, 4:30 AM
Seen: 3632 times
Last updated: 9/30/17, 9:42 AM